Non-programmer needs help with PyGTK-2.0.0

M

Mark Mitchell

-----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-----
 
G

Guest

Mark said:
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
 
P

P

Mark said:
-----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_view.php?by=name&name=pygtk2&ver=9.1
At least it will give you info on the right thing to do

Pádraig.
 
M

Mark Mitchell

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It often complains about missing functions, or something.
It compiles though, so I assume, it's built completely.


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-----
 
J

John Hunter

Mark> No, I compiled from source.

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

Mark Mitchell

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Why not try a prepackaged version?
http://www.linuxpackages.net/search_view.php?by=name&name=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-----
 
?

=?ISO-8859-1?Q?Holger_T=FCrk?=

Mark said:
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/


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.
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top