4

I am trying to download some modules on my windows machine, transfer them to offline Linux server via FTP where Python 3 and pip are installed. Then install the modules there using pip.

pip download --platform linux_x86_64 --only-binary=:all: --no-binary=:none:  pandas

gives the error:

  Could not find a version that satisfies the requirement pandas (from versions: )
No matching distribution found for pandas

I can download using the below command but it is the windows version

pip download pandas
BasaranBADUR
  • 61
  • 1
  • 8

2 Answers2

5

The platform linux_x86_64 is now named manylinux1_x86_64. So run

pip download --platform manylinux1_x86_64 --only-binary=:all: --no-binary=:none: pandas
phd
  • 57,284
  • 10
  • 68
  • 103
  • My issue with this one is dependencies. For instance when I try to download Paramiko, it tries to download pynacl>=1.0.1. Although there is ***PyNaCl-1.3.0-cp34-abi3-manylinux1_x86_64.whl (759.9 kB)*** on the PyPi, it gives the error: ```ERROR: Could not find a version that satisfies the requirement pynacl>=1.0.1 (from paramiko) (from versions: none) ERROR: No matching distribution found for pynacl>=1.0.1 (from paramiko)``` – BasaranBADUR Dec 02 '19 at 07:59
  • I tried `pip3.4 download --platform manylinux1_x86_64 --only-binary=:all: --no-binary=:none: paramiko` and `pip` downloaded `PyNaCl-1.3.0-cp34-abi3-manylinux1_x86_64.whl` for me. But failed at `pycparser`. This is because `pycparser` is only available as [source distribution](https://pypi.org/project/pycparser/2.19/#files) and the command line specifically forbids sdists. I don't think there is any way around it other than downloading packages on the target (native) platform. A virtual machine, a docker container, a WSL terminal. – phd Dec 02 '19 at 08:32
  • Thanks for the answer @phd! Works with pandas, how could I install the downloaded `.whl` file after this. – pc_pyr Jul 13 '20 at 10:54
  • @pc_pyr https://stackoverflow.com/a/14447068/7976758 – phd Jul 13 '20 at 10:56
  • When I try to install it says `pandas-1.0.5-cp37-cp37m-manylinux1_x86_64.whl is not a supported wheel on this platform` since it's a linux package on windows, is there a way to bypass this and install it @phd – pc_pyr Jul 13 '20 at 11:04
  • @pc_pyr No, you must have platform-specific wheels. Linux wheels on Linux, intel32/amd64 on Windows. – phd Jul 13 '20 at 11:10
  • Yes, but is there a way I could install linux package in windows @phd – pc_pyr Jul 13 '20 at 12:03
  • @pc_pyr No. Binary wheels contain extensions compiled by platform-specific compilers from C/C++ and these extensions can only be used at their proper platforms. – phd Jul 13 '20 at 12:25
-4

try using the code as

python3 -m pip download [package name]

Edit, if this not work: then download the package from pypi org and then run terminal where the file is located and then type python3 -m pip install copy the name of that package including .whl and then paste that name just after 'python3 -m pip install' hope it will work

PV8
  • 4,547
  • 3
  • 24
  • 52
AbdulRahim Khan
  • 101
  • 1
  • 3
  • I cannot download directly on the server. It has no connection. All I have is my windows machine and FTP to Linux server. – BasaranBADUR Nov 28 '19 at 07:43
  • then download the package from pypi org and then run terminal where the file is located and then type python3 -m pip install copy the name of that package including .whl and then paste that name just after 'python3 -m pip install' hope it will work – AbdulRahim Khan Nov 28 '19 at 07:48