Installing Python Packages Offline

Pratik Kate
1 min readMar 18, 2021
Python pip install

Step 1 : Download all packages present in requirements.txt file on source machine

NOTE : Operating system and CPU architecture of you source and destination machines should be same. Else your .whl file will mismatch and installation at destination machine won’t be successful even if you download all the packages.

pip download -r requirements.txt

You will find file ending with .whl, .tar.gz, .zip added next to requirement.txt file in same folder. Zip those files to move to you destination machine.

Step 2: Move downloaded packages to destination machine

Place all you downloaded .whl, .tar.gz, .zip files in one folder. Also copy your requirement.txt file to you destination machine as you will need it.

pip install --no-index --find-links <folder_path> -r requirements.txt

For example you have placed downloaded packages to C:\dev\python\offline_packages

pip install --no-index --find-links C:\dev\python\offline_packages -r requirements.txt

Done! You will see that packages are getting install offline.

--

--

Pratik Kate

An analytical and curious individual with 7+ years of problem-solving experience for Fortune 500 companies and startups. More : https://katepratik.com/