Search code examples
pythonpippypisite-packages

Install Python Packages to specified desitination(away from default or root)


Regarding installing Python Packages (PyPi), I am trying to define the individual library location(away from default or root). In other words, figure out how to specify the user library location. Right now when I install packages, it's default to home (or root), but it needs to be relocated to /data004. So, I am trying to get it off the root file system.

This is the code i use at the command line to install packages:

  • python -m pip install - - user SomeProject -f ./ - -no-index

Sample Code

Any ideas or tricks to work through this issue?


Solution

  • pip has an --install-option= feature

    PREFIX_PATH=/home/dkennetz/local_install/
    
    python -m pip install --install-option="--prefix=$PREFIX_PATH" PyDF2