Discussion:
[tryton] PyGTK import error
John
2018-04-05 16:08:33 UTC
Permalink
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?
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/2e6c0ea3-3728-42b7-83d4-c511797ed21a%40googlegroups.com.
Axel Braun
2018-04-05 16:38:23 UTC
Permalink
Am Donnerstag, 5. April 2018, 18:08:33 CEST schrieb John:
[...]
Post by 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
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/5329936.Eq86DutPln%40t520.axxite.internal.
John
2018-04-05 16:54:17 UTC
Permalink
Post by Axel Braun
[...]
Post by 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
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.
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/72e9f1e7-4668-4725-85ce-5f57a10019ee%40googlegroups.com.
Axel Braun
2018-04-05 17:17:32 UTC
Permalink
Post by John
Post by Axel Braun
[...]
Post by John
"/home/path/to/tryton/folder/env/local/lib/python2.7/site-packages/tryto
n/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
InsecurePlatformWarning
Could not find a version that satisfies the requirement python-gtk (from
versions: ) No matching distribution found for python-gtk
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.
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/
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/19802056.aaISVe5EJq%40t520.axxite.internal.
John
2018-04-05 17:27:23 UTC
Permalink
Post by Axel Braun
Post by John
Post by Axel Braun
[...]
Post by John
"/home/path/to/tryton/folder/env/local/lib/python2.7/site-packages/tryto
n/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
InsecurePlatformWarning
Could not find a version that satisfies the requirement python-gtk (from
versions: ) No matching distribution found for python-gtk
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.
It depends probably on the system that you are working on, which the 'correct'
https://pypi.org/project/PyGTK/
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/
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/e296fd7d-366b-44af-8228-485050192c1e%40googlegroups.com.
Cédric Krier
2018-04-05 17:26:41 UTC
Permalink
Post by John
InsecurePlatformWarning
Could not find a version that satisfies the requirement python-gtk (from versions: )
No matching distribution found for python-gtk
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: ***@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20180405172641.GF3910%40kei.
John
2018-04-05 17:44:58 UTC
Permalink
Post by Cédric Krier
Post by John
InsecurePlatformWarning
Could not find a version that satisfies the requirement python-gtk (from versions: )
No matching distribution found for python-gtk
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
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
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'
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/8a4e5201-dada-4c24-9f1e-1c2f777689b7%40googlegroups.com.
Cédric Krier
2018-04-05 21:47:05 UTC
Permalink
Post by John
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).
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.
--
Cédric Krier - B2CK SPRL
Email/Jabber: ***@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups "tryton" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/20180405214705.GH3910%40kei.
Continue reading on narkive:
Search results for '[tryton] PyGTK import error' (Questions and Answers)
4
replies
Choosing a language: questions on Python?
started 2011-07-25 11:01:15 UTC
programming & design
Loading...