Using virtualenv

From mn/bio/cees-bioinf
Revision as of 12:58, 26 January 2015 by Alexajo@uio.no (talk | contribs) (Created page with "virtualenv is a tool to create isolated Python environments. See [https://virtualenv.pypa.io/en/latest/index.html https://virtualenv.pypa.io/en/latest/index.html] === Setting...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

virtualenv is a tool to create isolated Python environments. See https://virtualenv.pypa.io/en/latest/index.html

Setting up virtualenv on the cod-nodes/abel

module load python2 virtualenv my_python_dir

will create locally a python tree.

Then you can run

cd my_python_dir ./bin/activate

And you're ready to go. Thsi will help to set paths properly:

export PYTHONPATH=$PYTHONPATH:$PWD/lib/python2.7/site-packages/

When using setup.py scripts

python setup.py install --prefix=/path/to/my_python_dir


Then to install a package not already in the python2 module do:

pip install package_name

this package (if found by pip) will be installed locally and reachable via the paths previously set up.