More newbie macosx user questions

Timothy Grant timothy.grant at gmail.com
Thu Feb 24 16:11:33 EST 2005


I think I'm mis-understanding something about how PYTHONPATH works (at
least on OSX I didn't have this trouble on Linux).

I have a directory where I store libraries that I'm playing around
with. However, for some reason python can't find the library. Since
I'm using PyQt, I use pythonw, but the results are identical with
python. It doesn't look like my PYTHONPATH is getting prepended to the
library path.

Can anyone tell me what I'm doing wrong?

(timothygrant at bastard%) echo $PYTHONPATH 
/Users/timothygrant/code/lib
(timothygrant at bastard%) ls $PYTHONPATH
NJB.py    NJB.pyc   _njb_c.so njb_c.py  njb_c.pyc
(timothygrant at bastard%) pythonw
Python 2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import NJB
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named NJB
>>> import sys
>>> for p in sys.path:
...     print p
... 

/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python23.zip
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-darwin
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/lib-scriptpackages
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-tk
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages



More information about the Python-list mailing list