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.

Installation error using pipenv + torchvision

See original GitHub issue

pipenv, version 6.2.4

Attempting to install pytorch. Torch installation succeeded but when trying to install torchvision, I encountered the error below. Installation succeeds via pip3 with no virtualenv.

Error is:

  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.6/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 1546, in update
    do_init(dev=dev, verbose=verbose)
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 809, in do_init
    do_lock()
  File "/usr/local/lib/python3.6/site-packages/pipenv/cli.py", line 673, in do_lock
    results = resolve_deps(deps, sources=project.sources)
  File "/usr/local/lib/python3.6/site-packages/pipenv/utils.py", line 70, in resolve_deps
    resolved_tree = resolver.resolve()
  File "/Users/rtyer/Library/Python/3.6/lib/python/site-packages/piptools/resolver.py", line 107, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/rtyer/Library/Python/3.6/lib/python/site-packages/piptools/resolver.py", line 195, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/rtyer/Library/Python/3.6/lib/python/site-packages/piptools/resolver.py", line 274, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/Users/rtyer/Library/Python/3.6/lib/python/site-packages/piptools/repositories/pypi.py", line 145, in get_dependencies
    self._dependencies_cache[ireq] = reqset._prepare_file(self.finder, ireq)
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/local/lib/python3.6/site-packages/pip/req/req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python3.6/site-packages/pip/utils/__init__.py", line 707, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /var/folders/m2/ffzxc7ts1hz2bdhgrx5k_jg40000gn/T/tmp5o1ytcl9build/torch/

Pipfile:

url = "https://pypi.python.org/simple"
verify_ssl = true

[packages]
torchvision = "*"

[packages.040d199]
file = "http://download.pytorch.org/whl/torch-0.2.0.post3-cp36-cp36m-macosx_10_7_x86_64.whl"

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

11reactions
rtyercommented, Sep 14, 2017

If anyone else stumbles across this, I was able to do:

pipenv run pip install --no-deps torchvision to proceed.

2reactions
syagevcommented, Dec 22, 2018

This workaround doesn’t update the Pipfile though right? So maybe the pipenv issue here is to have something like pipenv install --no-deps torchvision that will add torchvision to the Pipfile (and Pipfile.lock) with some special flag that says that dependencies are not to be installed. Another alternative is to install according to the order of the Pipfile and then in this case for example, one would make sure to put the pytorch wheel before the torchvision package

@kennethreitz - could you please comment regarding the above? What’s the correct way to deal with this? Thanks in advance!

Read more comments on GitHub >

github_iconTop Results From Across the Web

PyTorch installation with pipenv fails (pipenv install torch) #4422
Installing torch fails with error. Trying to install PyTorch on Win10 64bit, Python 3.8.5 64bit, doing either: pipenv install torch -> fails
Read more >
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 >
error: could not find a version that satisfies the requirement torch
pip install torchvision.whl. Another way is to install it through source: python setup.py install. Now in your case, to workaround the issue, use...
Read more >
Installation — detectron2 0.6 documentation
If the error comes from a pre-built torchvision, uninstall torchvision and pytorch and reinstall them following pytorch.org. So the versions will match. If...
Read more >
Installing PyTorch on Ubuntu 20.04 - Linode
This guide shows you how to install PyTorch on an Ubuntu 20.04 server. ... in our Using Pipenv to Manage Python Packages and...
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