export vars for python setup.py install --prefix
Asked Answered
H

2

1

When I install a python package with prefix

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

In ~/.bashrc, I modify the PATH environment var.

export PATH=$HOME/opt:$PATH

Are there any other environment variables that I need to modify?

Hilmahilt answered 5/7, 2012 at 14:51 Comment(2)
I need modify other environment variables ?Hilmahilt
You probably want to put $HOME/opt/bin in the PATH, not just the prefix.Fiber
A
0

You may need to modify PYTHONPATH.

Azarcon answered 5/7, 2012 at 14:55 Comment(1)
thanks, now work, with export PYTHONPATH=$HOME/opt/lib/python2.7/site-packagesHilmahilt
K
2

Use virtualenv for this. Virtualenv creates a directory which acts as a "little unix". You can activate and deactivate this environment as you like, and keep multiple environments for different purposes. Activating the environment will take care of all the environment variables.

http://pypi.python.org/pypi/virtualenv

virtualenv mynix
source mynix/bin/activate
cd packages/foo
python setup.py install
Knight answered 5/7, 2012 at 15:2 Comment(0)
A
0

You may need to modify PYTHONPATH.

Azarcon answered 5/7, 2012 at 14:55 Comment(1)
thanks, now work, with export PYTHONPATH=$HOME/opt/lib/python2.7/site-packagesHilmahilt

© 2022 - 2024 — McMap. All rights reserved.