How do you specify bin directory for pip install with --target option enabled

You can sudo ln -s ~/tmp_directory/gunicorn /usr/bin/gunicorn.

If I understand your needs correctly, you're suggested to try virtualenv, a tool to create isolated Python environments. You can install different versions of Python packages for each of your project on the same server. Highly recommended for Python development. I'm using virtualenvwrapper, a wrapper to make it a bit easier to use


I just found it's actually possible to tell 'pip' where to put scripts, data etc.

You can use --install-option to pass options to setuptools. So if you want to specify where to put scripts, you can:

pip install gunicorn --install-option="--install-scripts=$PWD/bin" -t python_modules/

Now you have gunicorn command inside bin/ in current directory and package installed in target dir python_modules.

bin/gunicorn

Tags:

Python

Pip