Pipenv: Not-helpful information when locking is failed: pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1

Created on 12 Sep 2019  Â·  10Comments  Â·  Source: pypa/pipenv

When I try to install some package (pycocotools), I encountered follwoing error.
This is not pipenv's fault, but I want pipenv to improve.

Current error message doesn't give information to solve the problem even with --verbose option.
We can't find why setup.py is failed.

So I suggest to add functionality "super verbose" mode, which show everything regarding the install process.

(n_project_bone) endo@ohmasa-com:~/works/codes/n_project_bone$ pipenv lock --clear --verbose
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✘ Locking Failed! 
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  opencv-python
  pillow
  pycocotools
  tensorflow

Finding the best candidates:
  found candidate opencv-python==4.1.1.26 (constraint was <any>)
  found candidate pillow==6.1.0 (constraint was <any>)
  found candidate pycocotools==2.0.0 (constraint was <any>)
  found candidate tensorflow==1.14.0 (constraint was <any>)

Finding secondary dependencies:
  tensorflow==1.14.0 not in cache, need to check index
  tensorflow==1.14.0        requires absl-py>=0.7.0, astor>=0.6.0, gast>=0.2.0, google-pasta>=0.1.6, grpcio>=1.8.6, keras-applications>=1.0.6, keras-preprocessing>=1.0.5, numpy<2.0,>=1.14.5, protobuf>=3.6.1, six>=1.10.0, tensorboard<1.15.0,>=1.14.0, tensorflow-estimator<1.15.0rc0,>=1.14.0rc0, termcolor>=1.1.0, wheel>=0.26, wrapt>=1.11.1
  opencv-python==4.1.1.26 not in cache, need to check index
  opencv-python==4.1.1.26   requires numpy>=1.11.3
  pillow==6.1.0 not in cache, need to check index
  pillow==6.1.0             requires -
  pycocotools==2.0.0 not in cache, need to check index
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/usr/local/lib/python3.6/dist-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/usr/local/lib/python3.6/dist-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmp_2psbq_0build/pycocotools/
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  opencv-python
  pillow
  pycocotools
  tensorflow

Finding the best candidates:
  found candidate opencv-python==4.1.1.26 (constraint was <any>)
  found candidate pillow==6.1.0 (constraint was <any>)
  found candidate pycocotools==2.0.0 (constraint was <any>)
  found candidate tensorflow==1.14.0 (constraint was <any>)

Finding secondary dependencies:
  tensorflow==1.14.0 not in cache, need to check index
  tensorflow==1.14.0        requires absl-py>=0.7.0, astor>=0.6.0, gast>=0.2.0, google-pasta>=0.1.6, grpcio>=1.8.6, keras-applications>=1.0.6, keras-preprocessing>=1.0.5, numpy<2.0,>=1.14.5, protobuf>=3.6.1, six>=1.10.0, tensorboard<1.15.0,>=1.14.0, tensorflow-estimator<1.15.0rc0,>=1.14.0rc0, termcolor>=1.1.0, wheel>=0.26, wrapt>=1.11.1
  opencv-python==4.1.1.26 not in cache, need to check index
  opencv-python==4.1.1.26   requires numpy>=1.11.3
  pillow==6.1.0 not in cache, need to check index
  pillow==6.1.0             requires -
  pycocotools==2.0.0 not in cache, need to check index
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/usr/local/lib/python3.6/dist-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/usr/local/lib/python3.6/dist-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/usr/local/lib/python3.6/dist-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python3.6/dist-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmp_2psbq_0build/pycocotools/
(n_project_bone) endo@ohmasa-com:~/works/codes/n_project_bone$ 
Error Handling Type

Most helpful comment

@themummy Also having this issue while trying to install tensorflow==2.0.0 with pipenv. With pip I can install without issue, but pipenv raise this error while trying to lock the pipfile. Any workarounds for now?

@sconetto Installing pipenv from master solved the issue for me:
pip install git+https://github.com/pypa/pipenv.git@master

All 10 comments

Yes it definitely needs to be improved, but I think you should fix in upstream pip-tools.

I'm having the same issue. Although, I only have the tensorflow==2.0.0 package.

I did use pip for each failed package to see details.
After fix all issues, pipenv worked well for me.

My problem is cleared with this workaround, but keeping this issue open to identify there's enhancement request.

Thanks.

@themummy Also having this issue while trying to install tensorflow==2.0.0 with pipenv. With pip I can install without issue, but pipenv raise this error while trying to lock the pipfile. Any workarounds for now?

@sconetto , unfortunately, not that I know of.

Having the same issue but with module pytest-cases.

I'm in an empty directory and I just run below:

$ pipenv install --verbose pytest-cases
Installing pytest-cases...
â ‹ Installing...Installing u'pytest-cases'
$ ['/home/alan/.local/share/virtualenvs/pipenv_bug_test-eHdXhTIQ/bin/pip', 'install', '--verbose', '--upgrade', 'pytest-cases', '-i', u'https://pypi.org/simple']
Adding pytest-cases to Pipfile's [packages]...
✔ Installation Succeeded 
Pipfile.lock not found, creating...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
✘ Locking Failed! 
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  pytest-cases

Finding the best candidates:
  found candidate pytest-cases==1.12.1 (constraint was <any>)

Finding secondary dependencies:
  pytest-cases==1.12.1 not in cache, need to check index
Traceback (most recent call last):
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpMzjhOfbuild/pytest-cases/
Using pip: -i https://pypi.org/simple
Using pip: -i https://pypi.org/simple

                          ROUND 1                           
Current constraints:
  pytest-cases

Finding the best candidates:
  found candidate pytest-cases==1.12.1 (constraint was <any>)

Finding secondary dependencies:
  pytest-cases==1.12.1 not in cache, need to check index
Traceback (most recent call last):
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 126, in <module>
    main()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 119, in main
    parsed.requirements_dir, parsed.packages)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 85, in _main
    requirements_dir=requirements_dir,
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/resolver.py", line 69, in resolve
    req_dir=requirements_dir
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/utils.py", line 726, in resolve_deps
    req_dir=req_dir,
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
    resolved_tree = resolver.resolve()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/utils.py", line 385, in resolve
    results = self.resolver.resolve(max_rounds=environments.PIPENV_MAX_ROUNDS)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 206, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 301, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 234, in get_dependencies
    legacy_results = self.get_legacy_dependencies(ireq)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 426, in get_legacy_dependencies
    results, ireq = self.resolve_reqs(download_dir, ireq, wheel_cache)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 297, in resolve_reqs
    results = resolver._resolve_one(reqset, ireq)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 260, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/resolve.py", line 213, in _get_abstract_dist_for
    self.require_hashes
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 294, in prepare_linked_requirement
    abstract_dist.prep_for_dist(finder, self.build_isolation)
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/operations/prepare.py", line 127, in prep_for_dist
    self.req.run_egg_info()
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/req/req_install.py", line 474, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/home/alan/.local/lib/python2.7/site-packages/pipenv/patched/notpip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpMzjhOfbuild/pytest-cases/

Looks similar to bug #3468

It is similar. I've just looked into the code and it's supposed to print the stdout and stderr from the external process (in this case the setup.py) but it does not do it. Even though there was one, in my case, I was able to identify it when manually running pip.

@themummy Also having this issue while trying to install tensorflow==2.0.0 with pipenv. With pip I can install without issue, but pipenv raise this error while trying to lock the pipfile. Any workarounds for now?

@sconetto Installing pipenv from master solved the issue for me:
pip install git+https://github.com/pypa/pipenv.git@master

@jtanios awesome! I was facing the same issue: just tensorflow 2.0 and after I upgraded my pipenv to master, the issue was gone!

I have just published a pre-release of the latest version of pipenv which leverages updates to pip-tools and pip. This should ideally resolve this issue, which I will close for now and encourage new reports in new issues.

To install the pre-release, you can run pip install --upgrade --pre pipenv

For what it's worth, I did look into this a bit and it appears that tensorflow specifically does not have wheels available yet for python 3.8 unless you install with the --pre option.

The pytest-cases issue appears to be resolved as well (I believe this package only works on python~=2.7.

Thanks for your patience all!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fbender picture fbender  Â·  3Comments

jakul picture jakul  Â·  3Comments

hynek picture hynek  Â·  3Comments

leileigong picture leileigong  Â·  3Comments

FooBarQuaxx picture FooBarQuaxx  Â·  3Comments