0

I have a Python project for which I created a requirements.txt file which contains following:

esoreader==1.2.3
matplotlib==3.6.2
pandas==1.5.2
Pillow==9.3.0
streamlit==1.14.1
streamlit-ext==0.1.4
streamlit-extras==0.2.4
st-pages==0.3.0
eppy==0.5.63
geomeppy==0.11.8
psychrolib==2.5.0
psychrochart==0.3.1
pvlib==0.9.3
enlopy==0.1.dev12
fpdf2==2.6.0

I can install all packages and relevant dependencies using 'pip install -r requirements.txt' to run the project in another system. However, any system which has firewall or other IT restrictions, is blocking installation of open-source packages.

I was wondering, if there is any way to download all relevant Python packages and dependencies using local install method which I can save in a folder maybe beforehand. It would then install them from that local folder without using network access.

Let me know if someone know how to do such?

Best,

Debayan

Debayan Paul
  • 95
  • 2
  • 9
  • AFAIK packages _are_ installed in a folder by pip... one of these ones https://stackoverflow.com/questions/29980798/where-does-pip-install-its-packages – Nick.Mc Feb 12 '23 at 21:32
  • 2
    Does this [post](https://stackoverflow.com/questions/11091623/how-to-install-packages-offline) help? – Pedro Rocha Feb 12 '23 at 21:34

1 Answers1

0
  1. device w/ network
pip download -d <dir> -r requirements.txt 
  1. copy<dir> to other device

  2. device w/o network

pip install --no-index --find-links <dir> -r requirements.txt
Peter
  • 10,959
  • 2
  • 30
  • 47
  • Hi, I have downloaded all the setup files and dependencies for Python packages in requirements.txt and saved them in a separate folder. For the step 3, the device without network, the '' should be the location of requirements.txt or the folder which contains all offline packages along with the 'requirements.txt' file inside of it? – Debayan Paul Feb 12 '23 at 23:45
  • Should be straight forward to find out? Typically, the requirements.txt is part of your project folder and you issue the command from there, venv activated. If not, you have to specify the path/to/requirements.txt. – Peter Feb 13 '23 at 06:29