Easy install to specific folder on machines without root

I’m using more & more remote machines in which I don’t have admin rights, so usual sudo easy_install isn’t working. But there is simple work around by installing Python packages to non-default directory.

# prepare new Python packages directory
mkdir -p ~/src/python/site-packages

# edit ~/.bashrc so Python knows where to look for packages
export PYTHONPATH=$PYTHONPATH:~/src:~/src/python:~/src/python/site-packages

# install packages
easy_install --install-dir /home/USER/src/python/site-packages PACKAGE_NAME

# ie for pysam installation you should do
easy_install --install-dir /home/lpryszcz/src/python/site-packages cython pyrex pysam

Leave a Reply

Your email address will not be published. Required fields are marked *