r/learnpython • u/SteveDev99 • Sep 30 '24
Best method to install pip packages without internet
I'm on a tight timeline on an extremely restricted work laptop. Now I convinced the IT department to get Python installed, but now the turned off Internet traffic. So Outlook and MS Treams is working internet wise, but no 'pip install'.
I can read files from the USB stick (however, I cannot write files on the USB stick).
What is the best way to install pip packages?
11
Upvotes
7
u/[deleted] Sep 30 '24
Based on how restrictive your IT department is I wouldn't be surprised if they didn't allow USB drives either. I used to work at a company like that.
4
u/m0us3_rat Sep 30 '24
give the .. requirements.txt to the IT guys to make sure you have what you need ?
trying to hack your way into a work laptop is a horribly stupid idea.
that will get you in trouble for no reason.
14
u/TehNolz Sep 30 '24
pip installalso accepts file archives, so you can just download a library from pypi.org and then install it that way. For example, to installrequests, you'd download it from here and then runpip install requests-2.32.3-py3-none-any.whl.Best just ask IT to allow
pipthough. IT departments don't like it when you try to bypass their restrictions.1
u/Dgb_iii Sep 30 '24
Are you able to use pythonanywhere and pip install on that? Been years since I used it
1
u/commy2 Sep 30 '24
In the past I had to e-mail me the wheel files, and then just ran this script:
You may have to run it over and over, because it's really dumb and may fail if a requirement comes alphabetically after a certain package.
0
u/[deleted] Sep 30 '24
[deleted] — view deleted comment