saving path to modules permanently

F

Frank

Hi,

I want to create some modules to use them in my programs. Now the
problem is, how to add the path to these modules permanently to the
python search path.

For example:

import sys
sys.path.append('path to my modules')


works fine for one session but does not save this path permanently. I
also tried alreday to set the PYTHONPAHT variable to my modules but
for some reason this does not work either.

Question:
Can one add a permenent path via pathon commands (I checked already
sys, but it does not seem to have a function for this).

If not, how to do it otherwise.

It would be great to give the precise commands if someone knows how.
(BTW, I use linux)

Thanks!

Frank
 
S

Steve Holden

Frank said:
Hi,

I want to create some modules to use them in my programs. Now the
problem is, how to add the path to these modules permanently to the
python search path.

For example:

import sys
sys.path.append('path to my modules')


works fine for one session but does not save this path permanently. I
also tried alreday to set the PYTHONPAHT variable to my modules but
for some reason this does not work either.

Question:
Can one add a permenent path via pathon commands (I checked already
sys, but it does not seem to have a function for this).

If not, how to do it otherwise.

It would be great to give the precise commands if someone knows how.
(BTW, I use linux)
Use

export PYTHONPATH=/path/to/module/directory

in your shell initialization file. Note that PYTHONPATH (not PYTHONPAHT)
must be an /environment/ variable, not just a shell variable.

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
Blog of Note: http://holdenweb.blogspot.com
See you at PyCon? http://us.pycon.org/TX2007
 

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

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,150
Latest member
MakersCBDReviews
Top