Martijn Brouwer wrote:

I have two versions of python installed (2.1 and 2.2) on a linux system running debian testing. For 2.1 I have PyGtk installed using the packages from the distribution, which works fine. Now I want to write a program myself using PyGtk and Gnome-Python version 1.99.13. Both are now installed in /home/martijn/sys/lib/python2.2/sitepackages. The listing of this directory looks like everything is OK.
drwxr-xr-x 5 martijn users 4096 Dec 27 16:08 gtk-2.0
-rw-r--r-- 1 martijn users 8 Dec 26 23:12 pygtk.pth
-rw-r--r-- 1 martijn users 2092 Dec 26 23:12 pygtk.py
-rw-r--r-- 1 martijn users 1841 Dec 26 23:12 pygtk.pyc
-rw-r--r-- 1 martijn users 1504 Dec 26 23:12 pygtk.pyo

Yet, when I export PYTHONPATH=/home/martijn/sys/lib/python2.2/sitepackages and start the python interpreter (2.2) I cannot import gtk: ImportError: No module named gtk

If you didn't install pygtk into the same prefix as python, you should add "pythonX.Y/site-packages/gtk-2.0" to the python path as well as "pythonX.Y/site-packages". Python only performs the .pth file parsing for what it considers "site" directories, which doesn't count things pulled in from PYTHONPATH.

James.

--
Email: [EMAIL PROTECTED] | Linux.conf.au http://linux.conf.au/
WWW: http://www.daa.com.au/~james/ | Jan 22-25 Perth, Western Australia.


_______________________________________________
pygtk mailing list [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/


Reply via email to