[pygtk] PyGTK on OSX for Python.org Python
Arjan Molenaar
gaphor at gmail.com
Mon Jun 8 13:45:09 WST 2009
hi,
On 7 Jun 2009, at 20:45, Chris Van Bael wrote:
> Hi,
>
> took a while before I had the time to search for it (in Spotlight)
>
> They can both be found in:
> myuser/gtk/source/pygtk/
>
> But I guess that's just the source for GTK+PyGTK.
> Doesn't Spotlight search in the Python tree?
If you search for "gtk" Spotlight should come up with a folder (.../
lib/python2.5/site-packages/gtk-2.0.
> I don't understand how this all works.
> In Library/Frameworks/Python.framework/Versions/Current/lib/
> python2.5/site-packages
> I see PyObjC and pygame. (that's the Python.org python I understood)
>
> In System/Library/Frameworks/Python.framework/Versions/Current/lib/
> python2.5
> there is no site-packages? So where should I search for the pyGTK I
> installed?
Hmm.. A third option may be $HOME/Library/Python/2.5/site-packages/.
Note that Python2.5 is the default python version on Mac OS X 10.5, so
installing Python.org's one is only confusing IMHO.
> Is there anywhere a guide explaining Python on Leopard, because the
> more I'm trying to do something, the more I'm getting confused.
I really don't know. I use Python installed from macports
(macports.org) and it works like a charm, as long as the PATH is
defined well (/opt/local/bin before /usr/bin).
You can also check sys.modules to see where a module resides (after
you imported pygtk):
>>> import sys
>>> sys.modules
{ returns a huge dict with module name -> module object }
Regards,
Arjan
> Thanks for any help,
> Chris
>
>
> On Mon,, Jun 1, 2009 at 7:09 PM, Arjan Molenaar<gaphor at gmail.com>
> wrote:
>> Hi Chris,
>>
>> Does a simple "import gtk" work? If not, where are the files
>> "pygtk.py" and
>> "gtk/__init__.py" located?
>>
>> Regards,
>>
>> Arjan
>>
>> On 17 May 2009, at 22:12, Chris Van Bael wrote:
>>
>>> Hi all,
>>>
>>> I'm trying to build an application on OS X.
>>> First I installed Python 2.5 from Python.org.
>>> Then I installed the binary build from PyGame.org.
>>>
>>> Someone gave me this link:
>>> http://live.gnome.org/GTK%2B/OSX/BuildInstructions
>>> to install PyGTK.
>>> I followed those instuctions and finally executed "jhbuild build
>>> pygtk".
>>> Got no errors.
>>> When I execute my Python.org python:
>>> cd //Library/Frameworks/Python.framework/Versions/Current/bin/
>>> ./Python
>>> I get:
>>> Python 2.5 (r25:51918, Sep 19 2006, 08:49:13)
>>> [GCC 4.0.1 (Apple Computer, Inc. build 5341)] on darwin
>>> Type "help", "copyright", "credits" or "license" for more
>>> information.
>>>>>>
>>>>>> import pygame
>>>>>> import pygtk
>>>
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> ImportError: No module named pygtk
>>>
>>> When I execute my System Python:
>>> cd //System/Library/Frameworks/Python.framework/Versions/Current/
>>> bin/
>>> ./python
>>> I get:
>>> Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
>>> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin
>>> Type "help", "copyright", "credits" or "license" for more
>>> information.
>>>>>>
>>>>>> import pygame
>>>
>>> Traceback (most recent call last):
>>> File "<stdin>", line 1, in <module>
>>> ImportError: No module named pygame
>>>>>>
>>>>>> import pygtk
>>>
>>> So PyGame is in my Python.org Python, but PyGTK is in my System
>>> Python
>>> and not in my Python.org Python.
>>> How can I solve this?
>>>
>>> Thanks for any help!
>>>
>>> Chris
>>> _______________________________________________
>>> pygtk mailing list pygtk at daa.com.au
>>> http://www.daa.com.au/mailman/listinfo/pygtk
>>> Read the PyGTK FAQ: http://faq.pygtk.org/
>>
>>
More information about the pygtk
mailing list