-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AttributeError: When using gi.repository you must not import static modules like "gobject". #106
Comments
I think this is mainly what needs to be done to move to GTK+3 (and also remove import gtk from cmd2).
|
Closed
coreycb
pushed a commit
to coreycb/cmd2
that referenced
this issue
Nov 20, 2017
pyperclip moved to GTK+ version 3 as a result of the following: asweigart/pyperclip#106
4 tasks
Also encountering this bug.
Linux Mint v18.2. |
living180
added a commit
to living180/upass
that referenced
this issue
Dec 5, 2023
pyperclip is abandoned upstream and is broken with GTK3 [1]. Switch to using pyclip instead. [1] asweigart/pyperclip#106 Signed-off-by: Daniel Harding <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using pyperclip in Ubuntu Artful, we are hitting the following AttributeError from pygobject:
AttributeError: When using gi.repository you must not import static modules like "gobject". Please change all occurrences of "import gobject" to "from gi.repository import GObject". See: https://bugzilla.gnome.org/show_bug.cgi?id=709183
For a much more detailed explanation and debug please see:
https://bugs.launchpad.net/ubuntu/+source/python-pyperclip/+bug/1722553
To reproduced this on Ubuntu Artful all you need to do is:
#!/usr/bin/env python
import keyring # imports gi
import pyperclip # imports gtk
pyperclip.paste()
Narrowing down a bit more, this can also be reproduced with the following python script:
#!/usr/bin/env python
import gtk
import gi
The 2 lines of code that appear to be conflicting are:
import gi
import gtk
And if I understand correctly from https://bugzilla.gnome.org/show_bug.cgi?id=709183, this is importing gtk+2 modules via 'import gtk' as well as gtk+3 modules via 'import gi' which causes module conflicts (according to the same bug).
From http://www.pygtk.org/: Note: New users are encouraged to use GTK+3 through the PyGObject bindings instead of using PyGTK with GTK+2.
So it seems to me that pyperclip in artful needs to move to GTK+3. Artful is set to release this week, but we can still backport a patch from upstream post release as a stable release update.
The text was updated successfully, but these errors were encountered: