Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bingefeller

macrumors 6502a
Original poster
Jun 25, 2007
573
25
Northern Ireland
Hi folks,

I'm trying to run a program called Nicotine+ on my Mac which is running 10.8.5. Nicotine+ requires GTK2, pyGTK2 and Python to run. I believe I have all of these installed via Macports.

When I try to run Nicotine+ I get this message:

'/Users/******/Downloads/nicotine+-1.2.16', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages']
Exception: No module named pygtk


If I run Python and type import pygtk I get this message:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named pygtk


can anyone help me please?
 

tag

macrumors 6502a
Apr 29, 2005
918
9
Something is wrong with pygtk. Either the install went wrong, or the module is not in your $PATH or PYTHONPATH. You'll either need to check to see if pygtk is installed in your python PATH or somewhere else and if so add the correct PATH environmental variable for the module in your .profile, or reinstall pygtk through macports if it was not installed correctly.
 

bingefeller

macrumors 6502a
Original poster
Jun 25, 2007
573
25
Northern Ireland
Something is wrong with pygtk. Either the install went wrong, or the module is not in your $PATH or PYTHONPATH. You'll either need to check to see if pygtk is installed in your python PATH or somewhere else and if so add the correct PATH environmental variable for the module in your .profile, or reinstall pygtk through macports if it was not installed correctly.


Can you please tell me how see if the module is in $PATH or PYTHONPATH?
 

tag

macrumors 6502a
Apr 29, 2005
918
9
Can you please tell me how see if the module is in $PATH or PYTHONPATH?

I don't have anything macports related installed anymore but I'll try to wing it and help...

Now that I think about it, it may not be simply a path problem. Did you install python from macports or are you using the python that came with OS X?

If you installed python through macports check out this thread, as it talks about what to do after installing python. I'm thinking that if you installed python through macports, that is not the default python (your system is probably using OS X python, which doesn't have the pygtk module installed).

If that is the case you will need to select the new macports version of python as a default (check out terminal command "port notes python27"), and everything should work for you. If that isn't the case, then we probably will need to edit your path to include the python module.

You can see what is currently in your path by in terminal typing..

Code:
echo $PATH
echo $PYTHONPATH

Also to see all environmental variables type...

Code:
printenv
 

bingefeller

macrumors 6502a
Original poster
Jun 25, 2007
573
25
Northern Ireland
I don't have anything macports related installed anymore but I'll try to wing it and help...

Now that I think about it, it may not be simply a path problem. Did you install python from macports or are you using the python that came with OS X?
[/QUOTE]

I am just using the Python that came with OS X.

You can see what is currently in your path by in terminal typing..

Code:
echo $PATH
echo $PYTHONPATH

Also to see all environmental variables type...

Code:
printenv

When I type echo $PATH i get this:

/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/lib/python2.7/site-packages:/opt/X11/bin


When I type echo $PYTHONPATH nothing happens...


When I type printenv I get the following:

TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/79/3vbblk_d53914j0_rz24mmsm0000gn/T/
Apple_PubSub_Socket_Render=/tmp/launch-OEqDIw/Render
TERM_PROGRAM_VERSION=309
TERM_SESSION_ID=AEACC426-1CAB-4AD7-B68F-414ECA0FCAB5
USER=*****
COMMAND_MODE=unix2003
SSH_AUTH_SOCK=/tmp/launch-Oyojwd/Listeners
__CF_USER_TEXT_ENCODING=0x1F5:0:0
Apple_Ubiquity_Message=/tmp/launch-oF4DVZ/Apple_Ubiquity_Message
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/lib/python2.7/site-packages:/opt/X11/bin
PWD=/Users/*****
LANG=en_GB.UTF-8
SHLVL=1
HOME=/Users/*****
LOGNAME=*****
DISPLAY=/tmp/launch-56RaSN/org.macosforge.xquartz:0
_=/usr/bin/PRINTENV
 

tag

macrumors 6502a
Apr 29, 2005
918
9
Your path seems to be alright from what I can tell, though like I said I'm not a macports expert.

As last post said via that link, you may need to use python_select to choose the macports version.
 

bingefeller

macrumors 6502a
Original poster
Jun 25, 2007
573
25
Northern Ireland
If you installed python through macports check out this thread, as it talks about what to do after installing python. I'm thinking that if you installed python through macports, that is not the default python (your system is probably using OS X python, which doesn't have the pygtk module installed).

If that is the case you will need to select the new macports version of python as a default (check out terminal command "port notes python27"), and everything should work for you. If that isn't the case, then we probably will need to edit your path to include the python module.

This got it working!!! Thanks a bunch!!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.