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.

PyTorch installation with pipenv fails (pipenv install torch)

See original GitHub issue

Installing torch fails with error

Trying to install PyTorch on Win10 64bit, Python 3.8.5 64bit, doing either: pipenv install torch -> fails or pipenv install torch===1.6.0 -> fails

However, pip install torch===1.6.0 works great!

Expected result

Describe what you expected.

Actual result

pipenv install torch===1.6.0 Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. Y ou can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning. Installing torch===1.6.0… Adding torch to Pipfile’s [packages]… Installation Succeeded Pipfile.lock (c14e35) out of date, updating to (023c79)… Locking [dev-packages] dependencies… Locking [packages] dependencies… Building requirements… Resolving dependencies… Locking Failed! CRITICAL:pipenv.patched.notpip._internal.index.package_finder:Could not find a version that satisfies the requirement torch===1.6.0 (from -r C:\AppData\Local \Temp\pipenvh5ftboijrequirements\pipenv-l9xes5ab-constraints.txt (line 2)) (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2) [ResolutionFailure]: File “c:/users/alon/appdata/local/programs/python/python38/lib/site-packages/pipenv/resolver.py”, line 785, in _main [ResolutionFailure]: resolve_packages(pre, clear, verbose, system, write, requirements_dir, packages) [ResolutionFailure]: File “c:/users/alon/appdata/local/programs/python/python38/lib/site-packages/pipenv/resolver.py”, line 746, in resolve_packages [ResolutionFailure]: results, resolver = resolve( [ResolutionFailure]: File “c:/users/alon/appdata/local/programs/python/python38/lib/site-packages/pipenv/resolver.py”, line 728, in resolve [ResolutionFailure]: return resolve_deps( [ResolutionFailure]: File “c:\appdata\local\programs\python\python38\lib\site-packages\pipenv\utils.py”, line 1378, in resolve_deps [ResolutionFailure]: results, hashes, markers_lookup, resolver, skipped = actually_resolve_deps( [ResolutionFailure]: File “c:\appdata\local\programs\python\python38\lib\site-packages\pipenv\utils.py”, line 1093, in actually_resolve_deps [ResolutionFailure]: resolver.resolve() [ResolutionFailure]: File “c:\appdata\local\programs\python\python38\lib\site-packages\pipenv\utils.py”, line 818, 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. First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again. Alternatively, 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.6.0 (from -r C:\AppData\Local\Temp\pipenvh5ftboijrequirements\pipenv-l9xes5ab-constraints.txt (line 2))

Steps to replicate

run: pipenv install torch===1.6.0


pipenv --support | clip Courtesy Notice: Pipenv found itself running within a virtual environment, so it will automatically use that environment, instead of creating its own for any project. Y ou can set PIPENV_IGNORE_VIRTUALENVS=1 to force pipenv to ignore that environment and create its own instead. You can set PIPENV_VERBOSITY=-1 to suppress this warning.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:4
  • Comments:11 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
Alon-Retispeccommented, Aug 13, 2020

Well, it’s less elegant but the way to do it is by going to the url at https://download.pytorch.org/whl/torch_stable.html and manually finding the relevant version for your system (in my case cu102/torch-1.6.0-cp38-cp38-win_amd64.whl). Then either running: pipenv install https://download.pytorch.org/whl/cu102/torch-1.6.0-cp38-cp38-win_amd64.whl Or using the pipfile:

[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true

[dev-packages]

[packages]
torch = {file = "https://download.pytorch.org/whl/cu102/torch-1.6.0-cp38-cp38-win_amd64.whl"}

6reactions
frostmingcommented, Aug 13, 2020

Pipenv and pip don’t work the same way. Try this Pipfile

[[source]]
name = "pytorch"
url = "https://download.pytorch.org/whl/torch_stable.html"
verify_ssl = false

[packages]
torch = {index = "pytorch",version = "==1.6.0"}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to install PyTorch with pipenv and save it to Pipfile and ...
But one problem remains: neither torch nor torchvision are being saved into Pipfile and Pipfile.lock. Any idea on how I can make this...
Read more >
pipenv Documentation - Read the Docs
Automatically adds/removes packages to a Pipfile when they are installed or uninstalled. ... pipenv install --index=pytorch torch.
Read more >
Common Pipenv Errors and How to Solve Them: Why Won't it ...
Here, you'll learn how to troubleshoot Pipenv installation and locking issues. ... installing a package, existent or not, causes the locking to fail....
Read more >
Pipenv istall pytorch with cuda error
Hello, I'm working on on a vertual envoronment and I have installed pipenv, but when I try to install pytorch 1.8.0 with cuda,with...
Read more >
How To Install Pytorch With Pipenv And Save It To ... - ADocLib
pipenv install torch skiplock Installing torch Adding torch to Pipfile's [packages] Installation Succeeded Installing dependencies from Pipfile An error.
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