Help Needed With A Python Problem

Discussion in 'Mac Programming' started by bingefeller, Sep 20, 2013.

  1. macrumors 6502

    Joined:
    Jun 25, 2007
    #1
    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?
     
  2. tag
    macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #2
    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.
     
  3. thread starter macrumors 6502

    Joined:
    Jun 25, 2007
    #3

    Can you please tell me how see if the module is in $PATH or PYTHONPATH?
     
  4. tag
    macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #4
    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
     
  5. thread starter macrumors 6502

    Joined:
    Jun 25, 2007
    #5
    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.

     
  6. tag
    macrumors 6502a

    tag

    Joined:
    Apr 29, 2005
    Location:
    PA, US
    #6
    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.
     
  7. thread starter macrumors 6502

    Joined:
    Jun 25, 2007
    #7
    This got it working!!! Thanks a bunch!!
     

Share This Page