Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to download pip packages for a different operating system?

Tags:

python

pip

I want to download pip packages so that later I could install it on a different machine (with a different OS). However the --download option downloads wheel files specific for the current OS.

Is there any way around this?

like image 239
Ankesh Anand Avatar asked Aug 31 '17 11:08

Ankesh Anand


People also ask

How do I download a specific version of pip?

How do I Install a Specific Version of a Python Package? To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .


2 Answers

You can run the following:

pip3 install --platform manylinux1_x86_64 --only-binary=:all:

The --only-binary=:all: is required when specifying --platform (if you omit it there is another parameter you can specify instead) and the platform itself can be found by looking at PyPi at the files for the package in question (https://pypi.org/project/Pillow/7.2.0/#files for example) - the platform is the last part of the filename e.g. win32, manylinux1_x86_64, manylinux1_i686 etc.

like image 163
tschumann Avatar answered Sep 22 '22 09:09

tschumann


pip download --platform

is the answer. Google what platforms are available :)

like image 28
campovski Avatar answered Sep 20 '22 09:09

campovski