Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pip: downloading dependencies to specific platform including non binaries

I'm trying to download the dependencies of paramiko from a linux host to a windows target which has no internet access .

After reading the example on pip's documentation I've used to following command in order to download the dependencies recursively to a 64 bit windows platform:

pip3 download --only-binary=:all: --platform win_amd64 --implementation cp paramiko

Was able to recursively download the dependencies until reaching pycparser. That is not surprising since I've used the --only-binary=:all: flag. Thing is - pip forces the usage of this flag when --platform flag is passed:

ERROR: --only-binary=:all: must be set and --no-binary must not be set (or must be set to :none:) when restricting platform and interpreter constraints using --python-version, --platform, --abi, or --implementation.

Terminal produced the following output:

Collecting paramiko
  Downloading paramiko-2.3.0-py2.py3-none-any.whl (182kB)
    100% |████████████████████████████████| 184kB 340kB/s 
  Saved ./paramiko-2.3.0-py2.py3-none-any.whl
Collecting pynacl>=1.0.1 (from paramiko)
  Using cached PyNaCl-1.1.2-cp35-cp35m-win_amd64.whl
  Saved ./PyNaCl-1.1.2-cp35-cp35m-win_amd64.whl
Collecting cryptography>=1.5 (from paramiko)
  Using cached cryptography-2.0.3-cp35-cp35m-win_amd64.whl
  Saved ./cryptography-2.0.3-cp35-cp35m-win_amd64.whl
Collecting pyasn1>=0.1.7 (from paramiko)
  Using cached pyasn1-0.3.5-py2.py3-none-any.whl
  Saved ./pyasn1-0.3.5-py2.py3-none-any.whl
Collecting bcrypt>=3.1.3 (from paramiko)
  Using cached bcrypt-3.1.3-cp35-cp35m-win_amd64.whl
  Saved ./bcrypt-3.1.3-cp35-cp35m-win_amd64.whl
Collecting cffi>=1.4.1 (from pynacl>=1.0.1->paramiko)
  Using cached cffi-1.11.0-cp35-cp35m-win_amd64.whl
  Saved ./cffi-1.11.0-cp35-cp35m-win_amd64.whl
Collecting six (from pynacl>=1.0.1->paramiko)
  Using cached six-1.11.0-py2.py3-none-any.whl
  Saved ./six-1.11.0-py2.py3-none-any.whl
Collecting asn1crypto>=0.21.0 (from cryptography>=1.5->paramiko)
  Using cached asn1crypto-0.22.0-py2.py3-none-any.whl
  Saved ./asn1crypto-0.22.0-py2.py3-none-any.whl
Collecting idna>=2.1 (from cryptography>=1.5->paramiko)
  Using cached idna-2.6-py2.py3-none-any.whl
  Saved ./idna-2.6-py2.py3-none-any.whl
Collecting pycparser (from cffi>=1.4.1->pynacl>=1.0.1->paramiko)
  Could not find a version that satisfies the requirement pycparser (from cffi>=1.4.1->pynacl>=1.0.1->paramiko) (from versions: )
No matching distribution found for pycparser (from cffi>=1.4.1->pynacl>=1.0.1->paramiko)

Is there a way of overcoming this issue? Will I have to manually install non-binary packages (and their dependencies)?

Thanks, Joey.

like image 321
Joey Avatar asked Sep 18 '17 19:09

Joey


People also ask

Does pip download download dependencies?

The pip download command can be used to download packages and their dependencies to the current directory (by default), or else to a specified location without installing them.

Does pip install dependencies of dependencies?

Pip will not flag dependency conflicts. As a result, it will happily install multiple versions of a dependency into your project, which will likely result in errors. One way to avoid dependency conflicts is to use an alternative Python package manager, like conda, poetry or ActiveState's State Tool.

What is the difference between pip install and pip download?

Overview. pip download does the same resolution and downloading as pip install , but instead of installing the dependencies, it collects the downloaded distributions into the directory provided (defaulting to the current directory).


1 Answers

You have two options:

  1. run the download operation on the same platform (be careful to be the same)
  2. fix the internet access on your host

Don't try other fancy method or you will shut yourself in the foot: some dependencies will need to compile!

like image 134
sorin Avatar answered Sep 30 '22 21:09

sorin