Skip to content
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

ImportError pygtkcompat #547

Closed
bayuiravvan opened this issue Dec 30, 2015 · 7 comments
Closed

ImportError pygtkcompat #547

bayuiravvan opened this issue Dec 30, 2015 · 7 comments
Labels
solution.Upstream It's a bug, but not ours

Comments

@bayuiravvan
Copy link

Hi, I successfully built mypaint on opensuse Leap 42.1, but mypaint doesn't run due to some ImportError exception. Here's the output from the console:

INFO: lib.i18n: POSIX: LANG='en_US.UTF-8'
INFO: lib.i18n: POSIX: LANGUAGE=None
WARNING: gui.gtk2compat: "import pygtkcompat" did not work, trying old deprecated way
Traceback (most recent call last):
  File "./mypaint", line 462, in <module>
    main.main(datapath, iconspath, old_confpath, version=version)
  File "/home/bayu/Sources/mypaint/gui/main.py", line 95, in main
    from gui import application
  File "/home/bayu/Sources/mypaint/gui/application.py", line 53, in <module>
    import gui.device
  File "/home/bayu/Sources/mypaint/gui/device.py", line 25, in <module>
    import gui.mode
  File "/home/bayu/Sources/mypaint/gui/mode.py", line 16, in <module>
    import gtk2compat
  File "/home/bayu/Sources/mypaint/gui/gtk2compat.py", line 83, in <module>
    orig_gtk = original_gtk()
  File "/home/bayu/Sources/mypaint/gui/gtk2compat.py", line 77, in original_gtk
    import gi.pygtkcompat
  File "/usr/lib64/python2.7/site-packages/gi/pygtkcompat.py", line 10, in <module>
ImportError: No module named pygtkcompat

Any suggestion? Thanks

@ghost
Copy link

ghost commented Jan 4, 2016

I use Ubuntu 12.04 LTS. I have similar error message I think :

$ mypaint
INFO: mypaint: Installation layout: conventional POSIX-like structure with prefix u'/usr/local'
INFO: lib.i18n: POSIX: LANG='tr_TR.UTF-8'
INFO: lib.i18n: POSIX: LANGUAGE=None
/usr/local/share/mypaint/lib/gettext.py:74: RuntimeWarning: C_(): g_dpgettext2() raised TypeError('Argument 0 does not allow None as a value',). Try a newer GLib?
  stacklevel = 1,
WARNING: gui.gtk2compat: "import pygtkcompat" did not work, trying old deprecated way
Traceback (most recent call last):
  File "/usr/local/bin/mypaint", line 462, in <module>
    main.main(datapath, iconspath, old_confpath, version=version)
  File "/usr/local/share/mypaint/gui/main.py", line 225, in main
    run()
  File "/usr/local/share/mypaint/gui/main.py", line 202, in run
    fullscreen = options.fullscreen,
  File "/usr/local/share/mypaint/gui/application.py", line 267, in __init__
    self.filehandler = filehandling.FileHandler(self)
  File "/usr/local/share/mypaint/gui/filehandling.py", line 145, in __init__
    gtk.RecentFilterFlags.URI
  File "/usr/lib/python2.7/dist-packages/gi/types.py", line 43, in function
    return info.invoke(*args, **kwargs)
TypeError: add_custom() takes exactly 4 non-keyword arguments (1 given)

Thanks.

@achadwick
Copy link
Member

@erdemoncel That message is unrelated to this issue, and we don't support Ubuntu 12.04 here any more: its GTK is too old http://packages.ubuntu.com/search?keywords=libgtk-3-0 vs. https://github.com/mypaint/mypaint/blob/dc79f2564ed08e3e36d9e951fc9a5f22efb86582/README.md#getting-started. Please upgrade your Ubuntu to at least 14.04. The instructions are here: https://wiki.ubuntu.com/TrustyTahr/ReleaseNotes#Upgrading_from_Ubuntu_12.04_LTS_or_Ubuntu_13.10.

@achadwick
Copy link
Member

@bayuiravvan
pygtkcompat.py needs to be installed somewhere. Please check that it is.

It's part of the python-gi package on Debian Unstable, but I don't know about RPM-based systems. Maybe it's python-gobject or python-gobject2 in SUSE?

It's been a standard part of Python GObject-Introspection for ages. The fact that gui/gtk2compat.py line 77 executed at all means that MyPaint tried the newest way of importing the compatibility layer and failed before you saw that message. I'm pretty certain you have a broken install.

Please can you let me know what exact version of MyPaint you tried to install, and what exact version of the Python GObject-Introspection module you have installed too.

@achadwick achadwick added the type.Support.User User needs support label Jan 5, 2016
@achadwick
Copy link
Member

@bayuiravvan if you're still reading this, sorry for the delayed response and thanks for reporting. For some reason this issue didn't appear on my screen till it got piggybacked. No excuse, but I've seen weirdnesses like this before from github recently. I hope it's not just me.

Anyway, the MyPaint issue tracker is not really intended for user support or installation woes. If you get no further fixing up your installation, let's continue this conversation in the MyPaint community forum.

Of course, if you think our docs are lacking and you've the skills to improve them, let me know and I'll turn this issue into a documentation issue instead and assign it to you 😀


TRIAGE: original report looks like a broken install. Close this report after a week if no further feedback is forthcoming.

Piggyback report is unrelated, and the Ubuntu version in it is unsupported for anything other than building for Travis.

@bayuiravvan
Copy link
Author

@achadwick no problem, I got my profile restored after github bot flagged me non-human, maybe that caused this issue not posted correctly.

Anyway, I checked my python-gi installation in /usr/lib64/python2.7/site-packages/gi/. For some strange reason all modules has source .py file, except pygtkcompat.py. It has only pygtkcompat.pyc and pygtkcompat.pyo.

I have MyPaint straight from cloning git source repo. Build process ran without any problem. I couldn't find Python GObject-Introspection package on suse, however the gi module I mentioned above was installed by python-gobject 3.16.2. I ran across this forum discussion which has exact same issue as mine. So, I think it might be Opensuse specific issue.

Thanks for your response, I'll let you know when the issue fixed. And btw, the build/install instruction is good, I followed through without problem.

@achadwick achadwick added solution.Upstream It's a bug, but not ours and removed type.Support.User User needs support labels Jan 5, 2016
@achadwick
Copy link
Member

@bayuiravvan Oh nasty. It looks like this should be reported to the upstream python-gobject maintainers here: https://build.opensuse.org/package/requests/devel:languages:python/python-gobject

  • pygtkcompat is a requirement for running MyPaint 1.2.0.
  • It's not "useless", as the package maintainers seem to think. Far from it.
  • OpenSUSE should not be removing that file if python-gobject is the only source of it.
  • Debian and MSYS2 retain it for 3.18.2. As far as I'm aware, dropping it is unusual.

Anyway, I'll close this issue as an upstream problem. We have #393 already open for removing the old PyGTK syntax that pygtkcompat supports, so just in case other distros get this kind of funny idea, I've bumped implementing that issue forwards to the 1st phase of 1.2.0 development.

@achadwick
Copy link
Member

(Well, really a downstream problem. But you get the idea.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution.Upstream It's a bug, but not ours
Development

No branches or pull requests

2 participants