BPm
BPm

Reputation: 2994

add module to pythonpath - nothing works

I don't have root access so I installed psycopg2 module to /opt (I have permission for that directory):

$python setup.py install --prefix=/opt

I've tried several methods:

#.bashrc        
PATH=$PATH:$HOME/bin:/opt/lib/python2.4/site-packages/psycopg2/
export PATH  

or

#.bash_profile  
PATH=$PATH:$HOME/bin:/opt/lib/python2.4/site-packages/
export PATH

I also tried sys.path.append('/opt/lib/python2.4/site-packages/psycopg2/')

nothing works:

$python  
>>>import psycopg2
>>>no psycopg2 module

Neither /opt/lib/python2.4/site-packages/psycopg2/ or /opt/lib/python2.4/site-packages/ path works

Please help, thank you

Upvotes: 9

Views: 21101

Answers (1)

lc2817
lc2817

Reputation: 3742

Try $PYTHONPATH instead of $PATH in your bash configuration file. For more info look at the official documentation on this topic.

Upvotes: 20

Related Questions