Patrick Selle
Patrick Selle

Reputation: 21

How can I download a pip whl, change the version of dependencies and build a whl file again to install it with pip?

I want to install PySyft via pip on a Jetson TX2. Unfortunately, I have a big problem with the dependencies here and the Jetson TX2. As an example, I want to change the dependency torch==1.4.0 to torch>=1.4.0 or torch==1.6.0 because I can't install another torch version for the Jetson.

I have already tried the following:

python3 -m pip download -w syft==0.2.3a1 --no-deps

and get a syft-0.2.3a1-py3-none-any.whl which I can unzip and read out the dependencies via the METADATA. Can I change it now as described above and build a *.whl again to install it using pip afterwards?

Upvotes: 2

Views: 1886

Answers (2)

gcrav
gcrav

Reputation: 99

Just... modify the extracted METADATA, recompress into a zip and rename to the same name as the original wheel?

I tried this approach and get some errors when repack.

A functional approach (maybe need more optmization):

  • unpack with wheel unpack <file.whl>;
  • rename folders;
    • mkdir newfolders;
    • cp files;
    • rm old folder
  • delete RECORDfile;
  • repack with wheel pack <renamed-folder>.

I do that with this script.

Upvotes: 2

AKX
AKX

Reputation: 168967

Just... modify the extracted METADATA, recompress into a zip and rename to the same name as the original wheel?

While you're at it, you may want to increment or change the version of the modified package.

Upvotes: 2

Related Questions