You are not logged in.

#1 2017-03-26 11:37:35

legacy.nl
Member
Registered: 2017-03-26
Posts: 14

[SOLVED]No module named pygtk (but it should be installed)

Hello!

I just started a new project in python using pygtk. I never used pygtk before, so I started with copying some code from the pygtk tutorial. It worked as expected and I was well on my way to implementing the things I wanted.

Couple of days later, I worked on it some more, but now I get "ModuleNotFoundError: No module named 'pygtk'".

According to Pacman it's installed. I triend uninstalling and reinstalling but Pacman didn't allow it because I have a lot of dependecies.

To test i'm trying to run this file: http://www.pygtk.org/pygtk2tutorial/exa … loworld.py
Which I had to convert to python 3 by changing the "print 'xxxx'" to "print('xxx')".

Maybe my Pythonpath got screwed up?

Python output of sys.path is :

['', '/usr/lib/python36.zip', '/usr/lib/python3.6', '/usr/lib/python3.6/lib-dynload', '/usr/lib/python3.6/site-packages']

The only reference to pygtk in those folders, is a directory called "pygtkcompat" in /usr/lib/python3.6/site-packages/

Any ideas how to fix this?

Last edited by legacy.nl (2017-03-26 12:48:34)

Offline

#2 2017-03-26 11:44:33

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED]No module named pygtk (but it should be installed)

You seem to be using python3. pygtk is only available for python2.

Offline

#3 2017-03-26 12:48:17

legacy.nl
Member
Registered: 2017-03-26
Posts: 14

Re: [SOLVED]No module named pygtk (but it should be installed)

Oh oops, such a rookie mistake.

Using "#!/usr/bin/env python2" it works!.

Thanks.

Offline

Board footer

Powered by FluxBB