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.
Asked
Active
Viewed 45 times
1 Answers
1
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

ventsyv
- 3,316
- 3
- 27
- 49
-
Thank you, should I download them to the python file? or another file? – FireFlower Aug 15 '23 at 22:33
-
Not sure what you mean. First try running `pip install --target /somedir/` - you might have the permissions to do that and pip will download the packages automatically. If thad doesn't work, just create a directory somewhere and use the process from the link to download the packages to that directory. – ventsyv Aug 16 '23 at 20:02