question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--find-links equivalent

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Using:

  • Python 3.7.3
  • Poetry 1.0.0b1

Feature Request

Because the CPU version of PyTorch is not on PyPI, they recommend installing it this way:

pip install torch==1.2.0+cpu --find-links https://download.pytorch.org/whl/torch_stable.html

However, there is no way to do this with Poetry?

Pointing directly to the wheel:

poetry add https://download.pytorch.org/whl/cpu/torch-1.2.0%2Bcpu-cp36-cp36m-manylinux1_x86_64.whl

results in

Updating dependencies
Resolving dependencies... (2.0s)


Package operations: 1 install, 0 updates, 0 removals

  - Installing torch (1.2.0+cpu https://download.pytorch.org/whl/cpu/torch-1.2.0%2Bcpu-cp36-cp36m-manylinux1_x86_64.whl)

[EnvCommandError]
Command ['/home/simmler/.cache/pypoetry/virtualenvs/epss-WeFenOJ_-py3.7/bin/python', '-m', 'pip', 'install', '--no-deps', 'torch==1.2.0+cpu'] errored with the following return code 1, and output: 
Collecting torch==1.2.0+cpu
  Could not find a version that satisfies the requirement torch==1.2.0+cpu (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 0.4.1, 0.4.1.post2, 1.0.0, 1.0.1, 1.0.1.post2, 1.1.0, 1.2.0)
No matching distribution found for torch==1.2.0+cpu

And adding https://download.pytorch.org/whl/torch_stable.html as a repository to the pyproject.toml does not work, because it (the PyTorch wheel index page) is not PEP conform.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:80
  • Comments:34 (5 by maintainers)

github_iconTop GitHub Comments

52reactions
Nathan-Furnalcommented, Dec 18, 2021

Hi! Is there any news on this issue?

16reactions
Korijncommented, Sep 12, 2020

The same is true for the latest stable pytorch and torchvision packages.

The officially recommended way is

pip install torch==1.5.1+cpu torchvision==0.6.1+cpu -f https://download.pytorch.org/whl/torch_stable.html

but without an equivalent to the -f option in poetry we can only add the wheels manually.

But adding the wheels manually fails because the solver thinks (1.5.1) != (1.5.1+cpu url)

$ poetry add --platform linux https://download.pytorch.org/whl/cpu/torchvision-0.6.1%2Bcpu-cp38-cp38-linux_x86_64.whl https://download.pytorch.org/whl/cpu/torch-1.5.1%2Bcpu-cp38-cp38-linux_x86_64.whl
Skipping virtualenv creation, as specified in config file.

Updating dependencies
Resolving dependencies... (36.4s)

[SolverProblemError]
Because myproject depends on torchvision (0.6.1+cpu url) which depends on torch (1.5.1), torch is required.
So, because myproject depends on torch (1.5.1+cpu url), version solving failed.

Should we split this into a new issue separate from the -f issue, though?

And adding here, what’s the recommended way to install pytorch and torchvision with poetry now? If it’s not possible (other than going through some 3rd party index as described above) that would be quite unfortunate.

See https://github.com/python-poetry/poetry/issues/2543 for the separate issue

For what it’s worth, I don’t think poetry needs this --find-links feature. Rather, the pytorch team needs to adopt proper packaging practices…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Equivalent for `--find-links` in `setup.py` - Stack Overflow
As pointed in my answer dependency_links seems to accept "URLs of web pages that contain direct download links" according to the setuptools ...
Read more >
Find External Links in an Excel File - Contextures Blog
Click the Find Links command, to open the Link Finder window. Select a file name from the drop down list, then select one...
Read more >
Quick Link Finder
Chrome-equivalent of Firefox's quick find (links only). You can search and click a link in a web page without using a mouse.
Read more >
How to Find Links Which Can Actually Help You Rank at the ...
To get a list of such pages, simply scrape the SERPs with the help of the SEOquake or any other similar tool. 2....
Read more >
How to find Links via SNMP or other API - Dell Community
If you mean link status (Ethernet device) on the data mover – that you can get via SNMP using the normal host MIB-II....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found