Python Package Offline

To install python packages offline (with no internet access), the simplest way is to dowload the packages with the dependencies on a server with internet access and the below command.

C:\Users\Nono\Desktop\python>pip download requests
Collecting requests  
  Using cached requests-2.25.1-py2.py3-none-any.whl (61 kB)  
Collecting urllib3<1.27,>=1.21.1  
  Using cached urllib3-1.26.3-py2.py3-none-any.whl (137 kB)  
Collecting certifi>=2017.4.17  
  Using cached certifi-2020.12.5-py2.py3-none-any.whl (147 kB)  
Collecting idna<3,>=2.5  
  Using cached idna-2.10-py2.py3-none-any.whl (58 kB)  
Collecting chardet<5,>=3.0.2  
  Using cached chardet-4.0.0-py2.py3-none-any.whl (178 kB)  
Saved c:\users\nono\desktop\python\requests-2.25.1-py2.py3-none-any.whl  
Saved c:\users\nono\desktop\python\certifi-2020.12.5-py2.py3-none-any.whl  
Saved c:\users\nono\desktop\python\chardet-4.0.0-py2.py3-none-any.whl  
Saved c:\users\nono\desktop\python\idna-2.10-py2.py3-none-any.whl  
Saved c:\users\nono\desktop\python\urllib3-1.26.3-py2.py3-none-any.whl  
Successfully downloaded requests certifi chardet idna urllib3

You then need to move all the files to the offline server in a directory and deploy the packages with the below command :

pip install --no-index --find-links=file:C:\Users\Nono2\tools\python-modules\resquests requests
Looking in links: file:///C:\Users\Nono2\tools\python-modules\resquests  
Collecting requestsCollecting urllib3<1.27,>=1.21.1 (from requests)  
Collecting chardet<5,>=3.0.2 (from requests)  
Collecting idna<3,>=2.5 (from requests)Collecting certifi>=2017.4.17 (from requests)  
Installing collected package: urllib3, chardet, idna, certifi, requests  
Successfully installed certifi-2020.12.5 chardet-4.0.0 idna-2.10 requests-2.25.1 urllib3-1.26.3