More newbie macosx user questions

T

Timothy Grant

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@bastard%) echo $PYTHONPATH
/Users/timothygrant/code/lib
(timothygrant@bastard%) ls $PYTHONPATH
NJB.py NJB.pyc _njb_c.so njb_c.py njb_c.pyc
(timothygrant@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.Traceback (most recent call last):
.... 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
 
K

Kevin Walzer

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This link might help:

http://www.astro.washington.edu/owen/AquaEnvVar.html



Timothy Grant wrote:
| 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@bastard%) echo $PYTHONPATH
| /Users/timothygrant/code/lib
| (timothygrant@bastard%) ls $PYTHONPATH
| NJB.py NJB.pyc _njb_c.so njb_c.py njb_c.pyc
| (timothygrant@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


- --
Cheers,

Kevin Walzer, PhD
WordTech Software--Open Source Applications and Packages for OS X
http://www.wordtech-software.com
http://www.smallbizmac.com
http://www.kevin-walzer.com
mailto:[email protected]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCHq1MJmdQs+6YVcoRAmVnAKCIL/ceAZVQXrvjIw/YE5OpeQTdcgCfc5FN
hJtbmQBCTnI/2wv4/CEuMcA=
=QxVP
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top