PyGTK import error

609 views
Skip to first unread message

John

unread,
Apr 5, 2018, 12:25:07 PM4/5/18
to tryton
Hi,

I've managed to get tryton working using SAO, however, when attempting to use the standard client, I get the following error:

$ tryton
Traceback (most recent call last):
File "/home/path/to/tryton/folder/env/bin/tryton", line 46, in <module>
from tryton import client
File "/home/path/to/tryton/folder/env/local/lib/python2.7/site-packages/tryton/client.py", line 170, in <module>
import pygtk
ImportError: No module named pygtk

Sao works decently, but has a number of quirks that make it less desirable especially for smaller screens. I am using a virtual environment, and I've tried installing pygtk without any success.

Any ideas how should I proceed?

Axel Braun

unread,
Apr 5, 2018, 12:38:25 PM4/5/18
to try...@googlegroups.com
Am Donnerstag, 5. April 2018, 18:08:33 CEST schrieb John:
[...]

> "/home/path/to/tryton/folder/env/local/lib/python2.7/site-packages/tryton/c
> lient.py", line 170, in <module> import pygtk
> ImportError: No module named pygtk
>
> Sao works decently, but has a number of quirks that make it less desirable
> especially for smaller screens. I am using a virtual environment, and I've
> tried installing pygtk without any success.
>
> Any ideas how should I proceed?

Install python-gtk

HTH
Axel


John

unread,
Apr 5, 2018, 1:10:07 PM4/5/18
to tryton
If I run "pip install python-gtk" I get:

InsecurePlatformWarning
Could not find a version that satisfies the requirement python-gtk (from versions: )
No matching distribution found for python-gtk

If I instead run "sudo pip isntall python-gtk" I get:

Downloading/unpacking python-gtk
Could not find any downloads that satisfy the requirement python-gtk
Cleaning up...
No distributions at all found for python-gtk

Either way installation fails.

Axel Braun

unread,
Apr 5, 2018, 1:17:34 PM4/5/18
to try...@googlegroups.com
It depends probably on the system that you are working on, which the 'correct'
name of the package is. On pypi for example, PyGTK is probably the right one:
https://pypi.org/project/PyGTK/



Cédric Krier

unread,
Apr 5, 2018, 1:30:07 PM4/5/18
to tryton
On 2018-04-05 09:54, John wrote:
> If I run "pip install python-gtk" I get:
>
> InsecurePlatformWarning
> Could not find a version that satisfies the requirement python-gtk (from versions: )
> No matching distribution found for python-gtk
>
> If I instead run "sudo pip isntall python-gtk" I get:
>
> Downloading/unpacking python-gtk
> Could not find any downloads that satisfy the requirement python-gtk
> Cleaning up...
> No distributions at all found for python-gtk
>
> Either way installation fails.

pygtk can not be installed via the setuptools of Python.
You can try to compile it in your virtualenv but it is going to be a
challenging task.

The best is to not use virtualenv for the client and to use the system
packages for pygtk (and the few other dependencies of tryton).
Or if your distribution has Tryton package, it will even be simpler.


PS: Do not hesitate to report issue with sao.
--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

John

unread,
Apr 5, 2018, 1:31:56 PM4/5/18
to tryton
Running "pip install PyGTK" seems to find the package, but it runs into a different error:

InsecurePlatformWarning
Downloading pygtk-2.24.0.tar.bz2 (2.4MB)
100% |████████████████████████████████| 2.4MB 580kB/s
Complete output from command python setup.py egg_info:
********************************************************************
* Building PyGTK using distutils is only supported on windows. *
* To build PyGTK in a supported way, read the INSTALL file. *
********************************************************************

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-QOAAmv/PyGTK/

John

unread,
Apr 5, 2018, 4:55:06 PM4/5/18
to tryton
This helped quite a bit, and I was able to again run the client outside the virtual environment; however, the version of that was 3.0.2 which was unable to connect to the tryton server running from the virtual env (version 4.6.2).

I upgraded the client version to the lastest one (4.6.5); however, I think that got me back to the issues I was having before using a virtual env. Now, when I try to run the tryton client I get:

Traceback (most recent call last):
File "/usr/bin/tryton", line 66, in <module>
tryton.client.TrytonClient().run()
AttributeError: 'module' object has no attribute 'client'

Cédric Krier

unread,
Apr 5, 2018, 5:50:06 PM4/5/18
to tryton
On 2018-04-05 10:44, John wrote:
> This helped quite a bit, and I was able to again run the client outside the virtual environment; however, the version of that was 3.0.2 which was unable to connect to the tryton server running from the virtual env (version 4.6.2).
>
> I upgraded the client version to the lastest one (4.6.5); however, I think that got me back to the issues I was having before using a virtual env. Now, when I try to run the tryton client I get:
>
> Traceback (most recent call last):
> File "/usr/bin/tryton", line 66, in <module>
> tryton.client.TrytonClient().run()
> AttributeError: 'module' object has no attribute 'client'

The installation seems broken.
I suggest to not install manually the client as root as it may break
your system. But instead just run it from the source directory.
Reply all
Reply to author
Forward
0 new messages