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.

ERROR: No matching distribution found for torch==1.11.0+cu113 when using --extra-index-url

See original GitHub issue

It seems that this error is also a problem when installing from other sources, such as in #5021.

Issue description

After lots of debugging and trial and error, we have run into a bug with pipenv relating to installing libraries while using another index url (–extra-index-url).

When trying to install PyTorch using the following command pipenv install --extra-index-url https://download.pytorch.org/whl/cu113/ "torch==1.11.0+cu113" Installing torch==1.11.0+cu113, as specified under this issue: https://github.com/pypa/pipenv/issues/4961, we get the following error: ERROR: No matching distribution found for torch==1.11.0+cu113.

According to @Bananaman this was possible to do in a previous version of pipenv.

Expected result

Expected an installation using a 3rd party index url, in this case PyTorch.

Actual result

daniel@daniel-desktop:~/Documents$ pipenv install --extra-index-url https://download.pytorch.org/whl/cu113/ "torch==1.11.0+cu113"
Installing torch==1.11.0+cu113...
Adding torch to Pipfile's [packages]...
✔ Installation Succeeded 
Pipfile.lock (db4242) out of date, updating to (7d86a3)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
✘ Locking Failed! 

CRITICAL:pipenv.patched.notpip._internal.resolution.resolvelib.factory:Could not find a version that satisfies the requirement torch==1.11.0+cu113 (from versions: 1.4.0, 1.5.0, 1.5.1, 1.6.0, 1.7.0, 1.7.1, 1.8.0, 1.8.1, 1.9.0, 1.9.1, 1.10.0, 1.10.1, 1.10.2, 1.11.0)
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 743, in _main
[ResolutionFailure]:       resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages, dev)
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 704, in resolve_packages
[ResolutionFailure]:       results, resolver = resolve(
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/resolver.py", line 685, in resolve
[ResolutionFailure]:       return resolve_deps(
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1398, in resolve_deps
[ResolutionFailure]:       results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps(
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/utils.py", line 1127, in actually_resolve_deps
[ResolutionFailure]:       resolver.resolve()
[ResolutionFailure]:   File "/home/daniel/.local/lib/python3.8/site-packages/pipenv/utils.py", line 905, in resolve
[ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  You can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: No matching distribution found for torch==1.11.0+cu113

Steps to replicate

Be sure to use the latest version of pipenv, if I use a previous version (latest confirmed is 2022.1.8) the error goes away.

  1. Create clean environment
  2. pipenv install --extra-index-url https://download.pytorch.org/whl/cu113/ "torch==1.11.0+cu113"
  3. Error should appear on latest version of pipenv

$ pipenv --support

Pipenv version: '2022.3.28'

Pipenv location: '/home/daniel/.local/lib/python3.8/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.8.12: /home/daniel/.pyenv/versions/3.8.12/bin/python
  • 3.8.10: /usr/bin/python3
  • 3.8.10: /usr/bin/python3.8
  • 3.8.10: /bin/python3
  • 3.8.10: /bin/python3.8

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.13.0-37-generic',
 'platform_system': 'Linux',
 'platform_version': '#42~20.04.1-Ubuntu SMP Tue Mar 15 15:44:28 UTC 2022',
 'python_full_version': '3.8.10',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • SESSION_MANAGER
  • QT_ACCESSIBILITY
  • COLORTERM
  • PYENV_SHELL
  • XDG_CONFIG_DIRS
  • XDG_MENU_PREFIX
  • GNOME_DESKTOP_SESSION_ID
  • MANDATORY_PATH
  • LC_ADDRESS
  • GNOME_SHELL_SESSION_MODE
  • LC_NAME
  • SSH_AUTH_SOCK
  • XMODIFIERS
  • DESKTOP_SESSION
  • LC_MONETARY
  • SSH_AGENT_PID
  • GTK_MODULES
  • PWD
  • LOGNAME
  • XDG_SESSION_DESKTOP
  • XDG_SESSION_TYPE
  • GPG_AGENT_INFO
  • XAUTHORITY
  • GJS_DEBUG_TOPICS
  • WINDOWPATH
  • HOME
  • USERNAME
  • IM_CONFIG_PHASE
  • LC_PAPER
  • LANG
  • LS_COLORS
  • XDG_CURRENT_DESKTOP
  • VTE_VERSION
  • GNOME_TERMINAL_SCREEN
  • INVOCATION_ID
  • MANAGERPID
  • GJS_DEBUG_OUTPUT
  • LESSCLOSE
  • XDG_SESSION_CLASS
  • SETUPTOOLS_USE_DISTUTILS
  • TERM
  • LC_IDENTIFICATION
  • DEFAULTS_PATH
  • LESSOPEN
  • USER
  • GNOME_TERMINAL_SERVICE
  • DISPLAY
  • SHLVL
  • LC_TELEPHONE
  • QT_IM_MODULE
  • LC_MEASUREMENT
  • LD_LIBRARY_PATH
  • XDG_RUNTIME_DIR
  • PYENV_ROOT
  • LC_TIME
  • JOURNAL_STREAM
  • XDG_DATA_DIRS
  • PATH
  • GDMSESSION
  • DBUS_SESSION_BUS_ADDRESS
  • LC_NUMERIC
  • OLDPWD
  • _
  • PIP_SHIMS_BASE_MODULE
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/daniel/.pyenv/shims:/home/daniel/.pyenv/bin:/usr/local/cuda-11.3/bin:/home/daniel/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/daniel/Documents

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:5
  • Comments:25

github_iconTop GitHub Comments

1reaction
matteiuscommented, Mar 31, 2022

Also, I just checked the wheel archive torch-1.11.0+cu113-cp310-cp310-win_amd64.whl and I don’t see where it would ever figure out that it need numpy implicitly – probably something you always have to manually install or add to the Pipfile as well I am guessing with that particular archive.

1reaction
matteiuscommented, Mar 31, 2022

Thanks for confirming this @DanielPerezJensen – I have a commit that ensure that the 1-hash that gets installed for “torch” or other index restricted packages gets included, but I’ve had more difficulties getting it to include all 8 hashes again. I think the ideal, would be it includes the two hashes that match your required python_version or all of them (all 8) if a version is not specified. I will be looking to find more time to look into this, at a minimum will ship new version in April that includes at least the matching hash, but ideally will figure out how to include all the relevant hashes as well for private index restricted packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues installing PyTorch 1.4 - "No matching distribution ...
Looks like this issue is related to virtual environment. Did you try recommended installation line in another/new one virtual environment?
Read more >
PyTorch pip installation not working - windows
Trying to install PyTorch with the given command from the homepage ... 0.1.2.post1, 0.1.2.post2) ERROR: No matching distribution found for ...
Read more >
could not find a version that satisfies the requirement torch ...
ERROR : No matching distribution found for torch==1.7.0 ... When trying to install PyTorch using the following command pipenv install --extra-index-url ...
Read more >
이전 버전의 PyTorch 설치하기
To install a previous version of PyTorch via Anaconda or Miniconda, replace “0.4.1” in the following commands with the desired version (i.e., “0.2.0”)....
Read more >
Problem with Torchlight when installing stable diffision 1.5
So, I had Stable Diffusion 1.4 working on my computer with Automatic1111, ... ERROR: No matching distribution found for torch==1.12.1+cu113.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

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