Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 20, 2013, 01:19 PM   #1
bingefeller
macrumors 6502
 
Join Date: Jun 2007
Help Needed With A Python Problem

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?
bingefeller is offline   0 Reply With Quote
Old Sep 20, 2013, 02:04 PM   #2
tag
macrumors 6502a
 
tag's Avatar
 
Join Date: Apr 2005
Location: PA, US
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.
tag is offline   0 Reply With Quote
Old Sep 20, 2013, 03:09 PM   #3
bingefeller
Thread Starter
macrumors 6502
 
Join Date: Jun 2007
Quote:
Originally Posted by tag View Post
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?
bingefeller is offline   0 Reply With Quote
Old Sep 20, 2013, 03:42 PM   #4
tag
macrumors 6502a
 
tag's Avatar
 
Join Date: Apr 2005
Location: PA, US
Quote:
Originally Posted by bingefeller View Post
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
tag is offline   0 Reply With Quote
Old Sep 20, 2013, 04:32 PM   #5
bingefeller
Thread Starter
macrumors 6502
 
Join Date: Jun 2007
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.

[QUOTE=tag;17960848]
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
bingefeller is offline   0 Reply With Quote
Old Sep 20, 2013, 04:42 PM   #6
tag
macrumors 6502a
 
tag's Avatar
 
Join Date: Apr 2005
Location: PA, US
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.
tag is offline   0 Reply With Quote
Old Sep 21, 2013, 04:16 AM   #7
bingefeller
Thread Starter
macrumors 6502
 
Join Date: Jun 2007
Quote:
Originally Posted by tag View Post

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!!
bingefeller is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
MBA Display problem, advice needed. Flying Dutchmen MacBook Air 0 Jun 5, 2013 05:22 PM
Problem With iPod Classic - Help needed! oreiarias iPod 1 May 11, 2013 07:55 PM
Resolved: Help needed with iPod 3rd Gen (20GB) odd problem... mlovergaard iPod 2 Mar 5, 2013 02:58 AM
Problem with order cancellation -- advice needed horsey59 Buying Tips and Advice 1 Oct 4, 2012 10:21 PM
Jailbroken Sprint Iphone 4s problem--Advice Needed joker07x iPhone Tips, Help and Troubleshooting 1 Sep 20, 2012 12:12 AM

Forum Jump

All times are GMT -5. The time now is 10:46 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC