How to install a package in the standard python environment i.e. /usr/local/lib/python2.7/dist-packages
using pip
and make this new packag
Use the --target
option when calling pip
pip install --target=/your/pyinstalldir loremipsum
The target directory must be a location writable by your user.
Note that this requires the regular user environment has the target directory present in the sys.path
. One possible way to achieve that is by using the PYTHONPATH
env var:
# /etc/profile.d/myenvvars.sh
export PYTHONPATH=/your/pyinstalldir