I'm missing something major here. I'm trying to add a directory to my
python path using the PYTHONPATH environment variable, and it's being
ignored by the Python interactive shell.
Below is a capture of what I did. Note that my newfolder appears
nowhere on the list of directories in sys.path. How do I get Python
to pay attention to my shell variables?
Using bash on OS X 10.4.10.
%:~ user$ echo $PYTHONPATH
%:~ user$ PYTHONPATH=/Users/user/newfolder
%:~ user$ echo $PYTHONPATH
/Users/user/newfolder
%:~ user$ python
Python 2.5.1 (r251:54863, Aug 10 2007, 10:46:58)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>import sys sys.path
['', '/usr/local/lib/python2.5/site-packages/
setuptools-0.7a1dev_r56320-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/ipython1-0.9alpha2-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/SQLAlchemy-0.4.0beta5-py2.5.egg', '/usr/local/lib/python2.5/
site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-i386.egg', '/usr/
local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/
python2.5/plat-darwin', '/usr/local/lib/python2.5/plat-mac', '/usr/
local/lib/python2.5/plat-mac/lib-scriptpackages', '/usr/local/lib/
python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/
lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/
PIL'] 4 6910
mhearne808[insert-at-sign-here]gmail[insert-dot-here]com schrieb:
I'm missing something major here. I'm trying to add a directory to my
python path using the PYTHONPATH environment variable, and it's being
ignored by the Python interactive shell.
Below is a capture of what I did. Note that my newfolder appears
nowhere on the list of directories in sys.path. How do I get Python
to pay attention to my shell variables?
Using bash on OS X 10.4.10.
%:~ user$ echo $PYTHONPATH
%:~ user$ PYTHONPATH=/Users/user/newfolder
%:~ user$ echo $PYTHONPATH
/Users/user/newfolder
%:~ user$ python
Python 2.5.1 (r251:54863, Aug 10 2007, 10:46:58)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>import sys sys.path
['', '/usr/local/lib/python2.5/site-packages/
setuptools-0.7a1dev_r56320-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/ipython1-0.9alpha2-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/SQLAlchemy-0.4.0beta5-py2.5.egg', '/usr/local/lib/python2.5/
site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-i386.egg', '/usr/
local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/
python2.5/plat-darwin', '/usr/local/lib/python2.5/plat-mac', '/usr/
local/lib/python2.5/plat-mac/lib-scriptpackages', '/usr/local/lib/
python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/
lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/
PIL']
Use
export PYTHONPATH=....
to pass environment vars to subprocesses.
Basic unix shell knowledge :)
$ man bash
....
export -p
The supplied names are marked for automatic export to
the envi-
ronment of subsequently executed commands. If the -f
option is
given, the names refer to functions. If no names are
given, or
if the -p option is supplied, a list of all names
that are
exported in this shell is printed. The -n option
causes the
export property to be removed from the named variables.
export
returns an exit status of 0 unless an invalid option is
encoun-
tered, one of the names is not a valid shell variable
name, or
-f is supplied with a name that is not a function.
....
Diez
On Oct 10, 11:00 pm, "mhearne808[insert-at-sign-here]gmail[insert-dot-
here]com" <mhearne...@gmail.comwrote:
I'm missing something major here. I'm trying to add a directory to my
python path using the PYTHONPATH environment variable, and it's being
ignored by the Python interactive shell.
Below is a capture of what I did. Note that my newfolder appears
nowhere on the list of directories in sys.path. How do I get Python
to pay attention to my shell variables?
Using bash on OS X 10.4.10.
%:~ user$ echo $PYTHONPATH
%:~ user$ PYTHONPATH=/Users/user/newfolder
%:~ user$ echo $PYTHONPATH
/Users/user/newfolder
%:~ user$ python
Python 2.5.1 (r251:54863, Aug 10 2007, 10:46:58)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>import sys
>sys.path
['', '/usr/local/lib/python2.5/site-packages/
setuptools-0.7a1dev_r56320-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/ipython1-0.9alpha2-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/SQLAlchemy-0.4.0beta5-py2.5.egg', '/usr/local/lib/python2.5/
site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-i386.egg', '/usr/
local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/
python2.5/plat-darwin', '/usr/local/lib/python2.5/plat-mac', '/usr/
local/lib/python2.5/plat-mac/lib-scriptpackages', '/usr/local/lib/
python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/
lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/
PIL']
Try
export PYTHONPATH=/Users/user/newfolder
Otherwise (without 'export') the variable is defined in the shell but
not passed on when you launch python.
Cheers,
Anthony
On Oct 11, 8:00 am, "mhearne808[insert-at-sign-here]gmail[insert-dot-
here]com" <mhearne...@gmail.comwrote:
I'm missing something major here. I'm trying to add a directory to my
python path using the PYTHONPATH environment variable, and it's being
ignored by the Python interactive shell.
Below is a capture of what I did. Note that my newfolder appears
nowhere on the list of directories in sys.path. How do I get Python
to pay attention to my shell variables?
Using bash on OS X 10.4.10.
%:~ user$ echo $PYTHONPATH
%:~ user$ PYTHONPATH=/Users/user/newfolder
%:~ user$ echo $PYTHONPATH
/Users/user/newfolder
%:~ user$ python
Python 2.5.1 (r251:54863, Aug 10 2007, 10:46:58)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>import sys
>sys.path
['', '/usr/local/lib/python2.5/site-packages/
setuptools-0.7a1dev_r56320-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/ipython1-0.9alpha2-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/SQLAlchemy-0.4.0beta5-py2.5.egg', '/usr/local/lib/python2.5/
site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-i386.egg', '/usr/
local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/
python2.5/plat-darwin', '/usr/local/lib/python2.5/plat-mac', '/usr/
local/lib/python2.5/plat-mac/lib-scriptpackages', '/usr/local/lib/
python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/
lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/
PIL']
You need to export the environment variable.
export PYTHONPATH
Graham
On Oct 10, 4:59 pm, Graham Dumpleton <Graham.Dumple...@gmail.com>
wrote:
On Oct 11, 8:00 am, "mhearne808[insert-at-sign-here]gmail[insert-dot-
here]com" <mhearne...@gmail.comwrote:
I'm missing something major here. I'm trying to add a directory to my
python path using the PYTHONPATH environment variable, and it's being
ignored by the Python interactive shell.
Below is a capture of what I did. Note that my newfolder appears
nowhere on the list of directories in sys.path. How do I get Python
to pay attention to my shell variables?
Using bash on OS X 10.4.10.
%:~ user$ echo $PYTHONPATH
%:~ user$ PYTHONPATH=/Users/user/newfolder
%:~ user$ echo $PYTHONPATH
/Users/user/newfolder
%:~ user$ python
Python 2.5.1 (r251:54863, Aug 10 2007, 10:46:58)
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type "help", "copyright", "credits" or "license" for more information.>>import sys
>>sys.path
['', '/usr/local/lib/python2.5/site-packages/
setuptools-0.7a1dev_r56320-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/ipython1-0.9alpha2-py2.5.egg', '/usr/local/lib/python2.5/site-
packages/SQLAlchemy-0.4.0beta5-py2.5.egg', '/usr/local/lib/python2.5/
site-packages/MySQL_python-1.2.2-py2.5-macosx-10.3-i386.egg', '/usr/
local/lib/python25.zip', '/usr/local/lib/python2.5', '/usr/local/lib/
python2.5/plat-darwin', '/usr/local/lib/python2.5/plat-mac', '/usr/
local/lib/python2.5/plat-mac/lib-scriptpackages', '/usr/local/lib/
python2.5/lib-tk', '/usr/local/lib/python2.5/lib-dynload', '/usr/local/
lib/python2.5/site-packages', '/usr/local/lib/python2.5/site-packages/
PIL']
You need to export the environment variable.
export PYTHONPATH
Graham
Thanks all - I'm recently back to using Unix (Mac) after 5 years of
being on a PC. I guess I thought export was just another way of doing
assignment. My bad.
--Mike This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Rami A. Kishek |
last post by:
Hi, I would really appreciate help on this from all ye Win-oriented
people. I have been using python under Linux for quite a while, know
little about windows.
I just upgraded my Python on WinME...
|
by: Eric Wichterich |
last post by:
Hello Pythonistas,
I am trying to get certain (self-written) libraries imported into my
scripts using statements like
"from library import function.py".
But they are not being found.
I...
|
by: r.e.s. |
last post by:
I have no PYTHONPATH nor any other python-related environment
variables, yet everything seems fine. (I'm using PythonWin
with winxp.) As long as modules are loaded through PythonWin,
is...
|
by: Tero Pihlajakoski |
last post by:
Hi,
I've been experimenting on embedding Python to a C software, and ran into
a little problem with PYTHONPATH (I'm running on linux). Here's the deal:
When trying to call...
|
by: D Denholm |
last post by:
I recently installed Python 2.2 on my WinXP box.
I am having problems figuring out how to create the PYTHONPATH
correctly.
I went to the WinXP SystemProperties > Advanced > Environment...
|
by: sushant.sirsikar |
last post by:
Hi,
I am using Linux env.I set the PYTHONPATH using
import sys
sys.path.append(----)
But we i close python and start again i is not showing my new entry in
PYTHONPATH.
Can anyone help me to...
|
by: Michael Yanowitz |
last post by:
Hello:
Someone on my team tried out installing my Python code and
found that setting PYTHONPATH does not work, but setting PATH
environment variable works the way PYTHONPATH should. Is that
how...
|
by: rh0dium |
last post by:
Hi all,
Can anyone help me out. I would like to have python automatically look
in a path for modules similar to editing the PYTHONPATH but do it at
compile time so every user doesn't have to do...
|
by: Aljosa Mohorovic |
last post by:
i have a working MySQLdb module (/usr/lib/python2.4/site-packages/
MySQL_python-1.2.2-py2.4-linux-i686.egg), using it without problems.
"clean shell" after login:
python -c "import MySQLdb"...
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
| |