Search code examples
pythonpiplocked-files

How can I use pip on a locked down computer


I’m using a locked down computer, and had to install the windows package version of python and can’t add it to the PATH variable. How can I use pip to install packages? If this is possible.


Solution

  • Depends how locked down it is, but maybe using pip in offline mode could work?

    How to install packages offline?

    Basically, you use pip --download on a machine that you have rights on, then zip the packages and you copy them on the locked down machine.

    You don't need to add python / pip to the path, just need to call it via alias / absolute path.

    You can run pip and install from the local folder. You can also tell pip where to install, in case you don't have access to the system directories. For example:

    pip install --no-index --find-links /path/to/download/dir/ --target /path/to/install/dir -r requirements.txt