By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,309 Members | 1,452 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,309 IT Pros & Developers. It's quick & easy.

Non-programmer needs help with PyGTK-2.0.0

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a program written in python that tells me it requires PyGTK, so I
DLed, ./configure, make, make install and the process seems to go ok. Some
errors but the process finishes so I assumed they weren't fatal errors.

So now I attempt to run my python program and I get;
$ gccp.py
Traceback (most recent call last):
File "./gccp.py", line 9, in ?
import pygtk
ImportError: No module named pygtk

I'm running Slackware 9.1 with a 2.6.6 kernel, and I don't know what other
information would be helpful.

Mark

- --
Remove both wrongs to make the email address right.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAtq9mLVmEOl6/PWERAhQlAJ9tftg6Bul2uBsi+4kxUbOQpXKuyACfV9WG
zC11tY3NhVmBqye0QPiYwoY=
=G1KG
-----END PGP SIGNATURE-----
Jul 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a


Mark Mitchell wrote:
I have a program written in python that tells me it requires PyGTK, so I
DLed, ./configure, make, make install and the process seems to go ok. Some
errors but the process finishes so I assumed they weren't fatal errors.
It often complains about missing functions, or something.
It compiles though, so I assume, it's built completely.

So now I attempt to run my python program and I get;
$ gccp.py
Traceback (most recent call last):
File "./gccp.py", line 9, in ?
import pygtk
ImportError: No module named pygtk

I'm running Slackware 9.1 with a 2.6.6 kernel, and I don't know what other
information would be helpful.


Most probably, pygtk is installed in a directory where python
cannot find it (i.e. the wrong directory). So setting PYTHONPATH
may help. If not:

Did you get python from a Slackware package?

Where's the python standard library?
in /usr/lib/python?.? or /usr/local/lib/python?.? ?

Where did it install pygtk?
/usr/lib/python?.?/site-packages or /usr/local/lib/python?.?/site-packages ?

What's your --prefix for ./configure ?

Greetings,

Holger

Jul 18 '05 #2

P: n/a
P
Mark Mitchell wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a program written in python that tells me it requires PyGTK, so I
DLed, ./configure, make, make install and the process seems to go ok. Some
errors but the process finishes so I assumed they weren't fatal errors.

So now I attempt to run my python program and I get;
$ gccp.py
Traceback (most recent call last):
File "./gccp.py", line 9, in ?
import pygtk
ImportError: No module named pygtk

I'm running Slackware 9.1 with a 2.6.6 kernel, and I don't know what other
information would be helpful.


Why not try a prepackaged version?
http://www.linuxpackages.net/search_...pygtk2&ver=9.1
At least it will give you info on the right thing to do

Pádraig.
Jul 18 '05 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2004-05-28, Holger Türk <ht**@gmx.de> wrote:


Mark Mitchell wrote:
I have a program written in python that tells me it requires PyGTK, so I
DLed, ./configure, make, make install and the process seems to go ok. Some
errors but the process finishes so I assumed they weren't fatal errors.
It often complains about missing functions, or something.
It compiles though, so I assume, it's built completely.

So now I attempt to run my python program and I get;
$ gccp.py
Traceback (most recent call last):
File "./gccp.py", line 9, in ?
import pygtk
ImportError: No module named pygtk

I'm running Slackware 9.1 with a 2.6.6 kernel, and I don't know what other
information would be helpful.


Most probably, pygtk is installed in a directory where python
cannot find it (i.e. the wrong directory). So setting PYTHONPATH
may help. If not:

Did you get python from a Slackware package?

No, I compiled from source.
Where's the python standard library?
in /usr/lib/python?.? or /usr/local/lib/python?.? ?
I have a /usr/lib/python2.3 that has a bunch of .py .pyo .pyc files, and
I also have a;
$ ls -l /usr/local/lib/python2.3/
total 1
drwxr-xr-x 3 root root 192 2004-05-26 23:56 site-packages/
Where did it install pygtk?
/usr/lib/python?.?/site-packages or /usr/local/lib/python?.?/site-packages ?
I'm not sure what exactly you're referring to here. Looking at my install
log, I have a number of .py .pyc .pyo files in
usr/local/lib/python2.3/site-packages/gtk-2.0/gtk/ and
usr/local/share/pygtk/2.0/

Is there a single filename or extension I should be looking for?
What's your --prefix for ./configure ?

I didn't use one, just straight ./configure.

Mark

- --
Remove both wrongs to make the email address right.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAt2fPLVmEOl6/PWERAkW2AKCw+gK/pTYQ7JdDTbh4jrO7TvPXiwCfVGBK
Hip5c0CaZ/T9NAuyvZfkfg4=
=8hIu
-----END PGP SIGNATURE-----
Jul 18 '05 #4

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 2004-05-28, P@draigBrady.com <P@draigBrady.com> wrote:
Mark Mitchell wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I have a program written in python that tells me it requires PyGTK, so I
DLed, ./configure, make, make install and the process seems to go ok. Some
errors but the process finishes so I assumed they weren't fatal errors.

So now I attempt to run my python program and I get;
$ gccp.py
Traceback (most recent call last):
File "./gccp.py", line 9, in ?
import pygtk
ImportError: No module named pygtk

I'm running Slackware 9.1 with a 2.6.6 kernel, and I don't know what other
information would be helpful.


Why not try a prepackaged version?
http://www.linuxpackages.net/search_...pygtk2&ver=9.1
At least it will give you info on the right thing to do

Two reasons, 1, I didn't know there was one. I may go that route in the
end. 2, I'd like to learn what I did wrong so that I have a better chance
of having it go flawlessly next time I have to install something like this.

Thanks for the link, though. It's bookmarked.

Mark

- --
Remove both wrongs to make the email address right.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAt2h3LVmEOl6/PWERAjjnAJ9wEZbFbXb6oHb8mmIrzsvgajSs7gCfQod+
Z5PwWZj3RIcUoOme5xcV9vU=
=fZsW
-----END PGP SIGNATURE-----
Jul 18 '05 #5

P: n/a
>>>>> "Mark" == Mark Mitchell <ma***********@wrongbellsouth.net> writes:

Mark> No, I compiled from source.

Try installing with 'python setup.py install' rather than
configure/make install.

Jul 18 '05 #6

P: n/a


Mark Mitchell wrote:
Where's the python standard library?
in /usr/lib/python?.? or /usr/local/lib/python?.? ?
I have a /usr/lib/python2.3 that has a bunch of .py .pyo .pyc files, and


Python got installed with prefix /usr
I also have a;
$ ls -l /usr/local/lib/python2.3/
total 1
drwxr-xr-x 3 root root 192 2004-05-26 23:56 site-packages/
Where did it install pygtk?
/usr/lib/python?.?/site-packages or /usr/local/lib/python?.?/site-packages ?


I'm not sure what exactly you're referring to here. Looking at my install
log, I have a number of .py .pyc .pyo files in
usr/local/lib/python2.3/site-packages/gtk-2.0/gtk/ and
usr/local/share/pygtk/2.0/


pygtk got installed with prefix /usr/local
_Your_ Python installation doesn't look there by default.
What's your --prefix for ./configure ?


I didn't use one, just straight ./configure.


Which means /usr/local.

Try setting PYTHONPATH to
/usr/local/lib/python2.3:\
/usr/local/lib/python2.3/site-packages:\
/usr/local/lib/python2.3/site-packages/gtk-2.0

If that doesn't work, do

../configure --prefix=/usr

instead of

../configure

as Sridhar R already pointed out.

Greetings,

Holger

Jul 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.