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?
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?
You may need to modify PYTHONPATH.
export PYTHONPATH=$HOME/opt/lib/python2.7/site-packages
–
Hilmahilt 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
You may need to modify PYTHONPATH.
export PYTHONPATH=$HOME/opt/lib/python2.7/site-packages
–
Hilmahilt © 2022 - 2024 — McMap. All rights reserved.