Xpra: Ticket #714: ImportError: No module named gi.repository

Hello, 1,8ghz I can run server, but no way to attach child session, I've tried rpm and building mode:

Platform:

uname -a
2.6.32-431.el6.i686
cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)
rpm -qa xpra
xpra-0.14.9-1.el6_5.i386
rpm -qa python
python-2.6.6-52.el6.i686

xpra server log and printenv are in attachments; All packages and its dependencies are resolved and installed;

Error when I launch "xpra attach":

[root@vShare ~]# xpra attach :100
Warning: running as root
xpra main error:
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/xpra/scripts/main.py", line 103, in main
    return run_mode(script_file, err, options, args, mode, defaults)
  File "/usr/lib/python2.6/site-packages/xpra/scripts/main.py", line 761, in run_mode
    return run_client(error_cb, options, args, mode)
  File "/usr/lib/python2.6/site-packages/xpra/scripts/main.py", line 1109, in run_client
    from xpra.platform.gui import init as gui_init
  File "/usr/lib/python2.6/site-packages/xpra/platform/gui.py", line 67, in <module>
    "system_bell")
  File "/usr/lib/python2.6/site-packages/xpra/platform/__init__.py", line 114, in platform_import
    platform_module = __import__(module, {}, {}, imports)
  File "/usr/lib/python2.6/site-packages/xpra/platform/xposix/gui.py", line 12, in <module>
    from xpra.gtk_common.error import trap, XError
  File "/usr/lib/python2.6/site-packages/xpra/gtk_common/error.py", line 42, in <module>
    gdk = import_gdk()
  File "/usr/lib/python2.6/site-packages/xpra/gtk_common/gobject_compat.py", line 83, in import_gdk
    return  _try_import(import_gdk3, import_gdk2)
  File "/usr/lib/python2.6/site-packages/xpra/gtk_common/gobject_compat.py", line 36, in _try_import
    imported = import_method_gtk3()
  File "/usr/lib/python2.6/site-packages/xpra/gtk_common/gobject_compat.py", line 80, in import_gdk3
    from gi.repository import Gdk                   #@UnresolvedImport
ImportError: No module named gi.repository


Tue, 14 Oct 2014 18:12:11 GMT - ilrobby: attachment set

Printenv


Tue, 14 Oct 2014 18:12:31 GMT - ilrobby: attachment set

ServerLog?


Wed, 15 Oct 2014 15:15:15 GMT - Antoine Martin: owner, priority, description changed

Warning: running as root


Is usually a sign that human error will follow.

I've tried rpm and building mode


Did you mix rpm install and install from source. Don't do that.

ImportError: No module named gi.repository


You are on python2, so it should load up the gtk2 client. But for some strange reason, importing the gtk2 classes failed.

I believe your installation is broken, or/and that you are missing some crucial pygtk packages.

Does this work:

python -c "from gtk import gdk;print(gdk)"

Wed, 15 Oct 2014 17:59:04 GMT - ilrobby:

Hi Totaam!

I've made a vm snapshot before xpra installation! I've tried first time with all the packages listed in "ftp rhel6_5 repo" and dep required for pkg listed there (some rpm requires other lib or sw); then I've revert snapshot and retry with all rpm + dep, and after, I've compiled the xpra source... Result are the same:

ImportError: No module named gi.repository

Output of your command:

[root@vShare ~]# python -c "from gtk import gdk;print(gdk)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 64, in <module>
    _init()
  File "/usr/lib/python2.6/site-packages/gtk-2.0/gtk/__init__.py", line 52, in _init
    _gtk.init_check()
RuntimeError: could not open display
[root@vShare ~]# export DISPLAY=172.16.4.3:0
[root@vShare ~]# python -c "from gtk import gdk;print(gdk)"
<module 'gtk.gdk' (built-in)>

Anyway, when I've exported display, no window appears...

Unfortunately I'm don't know at all Python language and I've really poor experiences with graphical library/env, also I've never change system linked library... sorry!


Thu, 16 Oct 2014 01:18:00 GMT - Antoine Martin: status changed; resolution set

If your DISPLAY is not set properly, you will not be able to launch any graphical applications, xpra or other.

You don't need to export the DISPLAY, just leave it alone and if you can launch an xterm, you can launch the xpra client.


Sat, 23 Jan 2021 05:03:48 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/714