Pipenv: Installation error using pipenv + torchvision

Created on 14 Sep 2017  路  10Comments  路  Source: pypa/pipenv

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:

```Traceback (most recent call last):
File "/usr/local/bin/pipenv", line 11, in
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:

```[[source]]
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"

Most helpful comment

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

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

All 10 comments

i don't think this is a pipenv issue.

Care to share any color as to why? I've since done this manually in virtualenv and pip3.

this looks like a pip / torchlight issue

you can still use pipenv, just have to pipenv run pip install ...

Thanks for that. Didn't work but it did show what the real issue is:

RuntimeError: PyTorch does not currently provide packages for PyPI (see status at https://github.com/pytorch/pytorch/issues/566).

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

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

This did it for me:

pip3 install torchvision --no-deps

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!

any updates on this thread? Still met this problem.

Would love to know solution for this
Has come up in Harvard Extension School class 'Advanced Python for Data Science' and many students trying to overcome it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

FooBarQuaxx picture FooBarQuaxx  路  3Comments

leileigong picture leileigong  路  3Comments

jacebrowning picture jacebrowning  路  3Comments

jerzyk picture jerzyk  路  3Comments

randName picture randName  路  3Comments