Pipenv: Command "python setup.py egg_info" failed with error code 1 i

Created on 10 Sep 2017  Â·  32Comments  Â·  Source: pypa/pipenv

Pipenv install is trying to install a library on a different python version.

I set pipenv to python 3.4.2 version, however, when I run pip install I get the following error :

screen shot 2017-09-10 at 1 54 04 pm

And as you can see it's trying to install a library on python2.7 (default python version).
Steps:

pip install pipenv
cd /path-project
pipenv --three
pipenv install

Got the error

pipenv --version

pipenv, version 6.2.1

Pipfile.lock

{
    "_meta": {
        "hash": {
            "sha256": "664809faca877e7d72716808d6be74ced6c98b258f95e418b5ee4a4b57762626"
        },
        "host-environment-markers": {
            "implementation_name": "cpython",
            "implementation_version": "3.4.2",
            "os_name": "posix",
            "platform_machine": "x86_64",
            "platform_python_implementation": "CPython",
            "platform_release": "16.7.0",
            "platform_system": "Darwin",
            "platform_version": "Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64",
            "python_full_version": "3.4.2",
            "python_version": "3.4",
            "sys_platform": "darwin"
        },
        "pipfile-spec": 3,
        "requires": {},
        "sources": [
            {
                "url": "https://pypi.python.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
    ....

Most helpful comment

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ZPv0av/cairocffi/

I am facing this issue please help.

All 32 comments

Did you install pipenv with Python 2.7? It's using that pip to resolve the dependencies.

pip version:
pip 9.0.1 from /home/joshua/.local/lib/python3.5/site-packages (python 3.5)
python version:
Python 3.5.2

I was using pipenv to setup an python2 venv when got this error

  File "/home/joshua/.local/lib/python3.5/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 /tmp/tmp9b9z51_sbuild/scapy/

sounds like you're having trouble installing a python module — not a pipenv problem ;)

I am also suffering this issue. But it is hard to recreate it. It just happens sometimes.

I have no problems with exact same packages with pip, and as I can see they are installed. It is breaking on 'Locking dev-dependencies':

Adding pre-commit==1.1.2 to Pipfile's [dev-packages]…
Locking [dev-packages] dependencies…
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/cli.py", line 1532, in install
    do_lock(system=system)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/cli.py", line 907, in do_lock
    project=project
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/utils.py", line 217, in resolve_deps
    resolved_tree = resolver.resolve()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/resolver.py", line 107, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/resolver.py", line 195, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/resolver.py", line 274, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/repositories/pypi.py", line 145, in get_dependencies
    self._dependencies_cache[ireq] = reqset._prepare_file(self.finder, ireq)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/pip/req/req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/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/qn/2gssw9hx48g81chw0398hlrr0000gn/T/tmpf93If1build/ipython/

@sobolevn please share your Pipfile.

I've seen this behavior too — seems to be non-deterministic, and highly-dependent on the python environment.

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

[dev-packages]

flake8-builtins = "==0.2"
flake8-commas = "==0.4.3"
flake8-quotes = "==0.9.0"
pytest = "==3.0.7"
pytest-flake8 = "==0.8.1"
pytest-isort = "==0.1.0"
ipython = "*"
gitlint = "*"
flake8-blind-except = "*"
pytest-django = "*"
pytest-xdist = "*"
safety = "*"
django-debug-toolbar = "*"
pre-commit = "==1.1.2"

[packages]

django = ">=1.11,<1.12"
django-split-settings = "*"
psycopg2 = "*"
django-axes = "*"

Link: https://github.com/wemake-services/wemake-django-template/blob/master/%7B%7B%20cookiecutter.project_name%20%7D%7D/Pipfile

After removing ipython from Pipfile everything worked well.

@sobolevn interesting. I locked that pipfile 5 times locally and everything worked fine.

What data can I provide to help you with troubleshooting?

None, other than running $ pipenv lock --verbose

Sounds like one of the packages has a wonky setup.py file — nothing we can do about that. If you think it's ipython, that wouldn't surprise me one bit.

» pipenv lock --verbose
Locking [dev-packages] dependencies…

                          ROUND 1                           
Current constraints:
  django-debug-toolbar
  flake8-blind-except
  flake8-builtins==0.2
  flake8-commas==0.4.3
  flake8-quotes==0.9.0
  gitlint
  ipython
  pre-commit==1.1.2
  pytest==3.0.7
  pytest-django
  pytest-flake8==0.8.1
  pytest-isort==0.1.0
  pytest-xdist
  safety

Finding the best candidates:
  found candidate django-debug-toolbar==1.8 (constraint was <any>)
  found candidate flake8-blind-except==0.1.1 (constraint was <any>)
  found candidate flake8-builtins==0.2 (constraint was ==0.2)
  found candidate flake8-commas==0.4.3 (constraint was ==0.4.3)
  found candidate flake8-quotes==0.9.0 (constraint was ==0.9.0)
  found candidate gitlint==0.8.2 (constraint was <any>)
  found candidate ipython==6.2.0 (constraint was <any>)
  found candidate pre-commit==1.1.2 (constraint was ==1.1.2)
  found candidate pytest==3.0.7 (constraint was ==3.0.7)
  found candidate pytest-django==3.1.2 (constraint was <any>)
  found candidate pytest-flake8==0.8.1 (constraint was ==0.8.1)
  found candidate pytest-isort==0.1.0 (constraint was ==0.1.0)
  found candidate pytest-xdist==1.20.0 (constraint was <any>)
  found candidate safety==1.5.1 (constraint was <any>)

Finding secondary dependencies:
  pre-commit==1.1.2         requires aspy.yaml, cached-property, identify>=1.0.0, nodeenv>=0.11.1, pyyaml, six, virtualenv
  pytest-xdist==1.20.0      requires execnet>=1.1, pytest-forked, pytest>=3.0.0
  flake8-commas==0.4.3      requires flake8<4.0.0,>=2
  gitlint==0.8.2            requires arrow==0.10.0, Click==6.6, ordereddict==1.1, sh==1.11; sys_platform != "win32"
  flake8-blind-except==0.1.1 requires setuptools
  pytest==3.0.7             requires py>=1.4.29, setuptools
  flake8-quotes==0.9.0      requires flake8
  ipython==6.2.0 not in cache, need to check index
Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/cli.py", line 1649, in lock
    do_lock(verbose=verbose, clear=clear)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/cli.py", line 907, in do_lock
    project=project
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/utils.py", line 217, in resolve_deps
    resolved_tree = resolver.resolve()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/resolver.py", line 107, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/resolver.py", line 195, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/resolver.py", line 274, in _iter_dependencies
    dependencies = self.repository.get_dependencies(ireq)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/piptools/repositories/pypi.py", line 145, in get_dependencies
    self._dependencies_cache[ireq] = reqset._prepare_file(self.finder, ireq)
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 634, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 129, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/pip/req/req_install.py", line 439, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/Users/sobolev/.pipsi/pipenv/lib/python2.7/site-packages/pipenv/patched/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/qn/2gssw9hx48g81chw0398hlrr0000gn/T/tmpy2igTrbuild/ipython/

Also, safety is built into pipenv now! You can just run pipenv check and it'll run safety for you :)

Yeah, i'm not sure there's anything we can do about that. I'd raise the issue with pip-tools, see if they have any answers.

Check out pipenv check and let me know what you think :)

Nice! Replaced my old configuration with pipenv check.

<3

Hi, this happened to me as well on package psycopg2.
The requirements.txt contained a ref to pscopg2==2.6.2. I have version 2.7.2.
When I updated the requirements.txt to ==2.7.2, pipenv install worked fine.

I am getting the same error trying to install jupyter.

I create a new environment

pipenv --three

then I try to install

pipenv install jupyter

Traceback (most recent call last):
  File "/usr/local/bin/pipenv", line 11, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/site-packages/pipenv/vendor/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 1847, in install
    do_lock(system=system, pre=pre)
  File "/usr/local/lib/python2.7/site-packages/pipenv/cli.py", line 1082, in do_lock
    pre=pre
  File "/usr/local/lib/python2.7/site-packages/pipenv/utils.py", line 452, in resolve_deps
    resolved_tree.update(resolver.resolve(max_rounds=PIPENV_MAX_ROUNDS))
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 102, in resolve
    has_changed, best_matches = self._resolve_one_round()
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 200, in _resolve_one_round
    for dep in self._iter_dependencies(best_match):
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/resolver.py", line 278, in _iter_dependencies
    for dependency in self.repository.get_dependencies(ireq):
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/piptools/repositories/pypi.py", line 153, in get_dependencies
    result = reqset._prepare_file(self.finder, ireq)
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 639, in _prepare_file
    abstract_dist.prep_for_dist()
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/pip/req/req_set.py", line 134, in prep_for_dist
    self.req_to_install.run_egg_info()
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/pip/req/req_install.py", line 438, in run_egg_info
    command_desc='python setup.py egg_info')
  File "/usr/local/lib/python2.7/site-packages/pipenv/patched/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/g1/srsny26x1ddfd469qxj675zw0000gn/T/tmpxfkWdlbuild/functools32/

If I run pip install --three jupyter, it removes the existing Python3 environment, creates a new Python3 environment and then I get the same error message again.

If I remove the Pipfile and Pipfile.lock and redo using Python 2 pip install --two jupyter, everything runs smoothly and installs.

It seems that if you want to install Jupyter for a Python3 environment, it wants to be installed using pip3 explicitly (at least that is what they say in the installation instructions).

If I understand correctly, pipenv will invoke pip to do the package installation but if you have a legacy Python2 installation, pip will point to pip2. So what do you do in this case when you want to create a Python3 environment?

My expectation was that when I create a new environment with pipenv --three, it should invoke pip3 each time I install a package via pipenv install package. It doesn't seem to be the case or am I doing something wrong?

@nsecord please open a separate issue and provide relevant information including everything the issue template asks for as well as the output of which pip && which pipenv && which python && pip --version && pipenv --version && python --version && env

I had the same problem. Upgrading the pip from 8 to 9, resolved my issue!

for me, on Mac OSX High Sierra, what fixed my issue with getting the error message: Command "python setup.py egg_info" failed with error code 1

sudo pip install pyobjc-core
sudo pip install pyobjc

I had this problem on macOS. I fixed it by removing everything installed through homebrew and re-installing Python 3.6.

Hello, am facing the same error on windows:

  • installed python-3.6.4-embed-amd64 as a zip file
    -set PATH env variable for python, installed pip
    -when i run python -m pip install awscli i get below error:

Running setup.py (path:C:\Users\user\AppData\Local\Temppip-build-7grntnir\PyYAML\setup.py) egg_info for package PyYAML
Running command python setup.py egg_info
running egg_info
creating pip-egg-info\PyYAML.egg-info
writing pip-egg-info\PyYAML.egg-info\PKG-INFO
writing dependency_links to pip-egg-info\PyYAML.egg-info\dependency_links.txt
writing top-level names to pip-egg-info\PyYAML.egg-info\top_level.txt
writing manifest file 'pip-egg-info\PyYAML.egg-info\SOURCES.txt'
error: [Errno 2] No such file or directory: 'C:\python-3.6.4-embed-amd64\python36.zip\lib2to3\Grammar.txt'
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in C:\Users\user\AppData\Local\Temppip-build-7grntnir\PyYAML\
Exception information:
Traceback (most recent call last):
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\req\req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\req\req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\req\req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "C:\python-3.6.4-embed-amd64\lib\site-packagespip\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 C:\Users\user\AppData\Local\Temppip-build-7grntnir\PyYAML\

Though the error complains about this file missing: error: [Errno 2] No such file or directory: 'C:\python-3.6.4-embed-amd64\python36.zip\lib2to3\Grammar.txt'

i have this file in that the same location, still i have this error. Any help appreciated!

My pip version is:

C:\python-3.6.4-embed-amd64\Lib\site-packagespip>python -m pip --version
pip 9.0.1 from C:\python-3.6.4-embed-amd64\lib\site-packages (python 3.6)

macOS Sierra
upgrading pyobjc-core also worked for me.

hello dear sir/mam , I m also getting same error in python 3.4 plzz help me.
C:\Users>pip install oauth2==1.5.211
Collecting oauth2==1.5.211
Using cached https://files.pythonhosted.org/packages/ef/36/7da831a06da70fb15858773a1d709606abcd05fae417bdf7a8cf5349450c/oauth2-1.5.211.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "C:\Users\AppData\Local\Temppip-install-oef36la6\oauth2\setup.py", line 18
print "unable to find version in %s" % (VERSIONFILE,)
^
SyntaxError: invalid syntax

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in C:\User\AppData\Local\Temppip-install-oef36la6\oauth2\

@Sunilsma oauth2 1.5.211 does not support Python 3.4. You can clearly see Python 2 syntax in the traceback, which shouldn’t have triggered alarms if you read it. I don’t know what you’re trying to achieve here.

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-ZPv0av/cairocffi/

I am facing this issue please help.

we have significantly better error handling around this in an upcoming release

that said, you would need to provide additional detail to troubleshoot your actual problem which may or may not be resolved by that error handling.

@techalchemy how do we get better error logs from this? I'm passing --verbose and still just getting this pipenv.patched.notpip._internal.exceptions.InstallationError with no other output.

I am getting error

pipenv.patched.notpip._internal.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/tmpapn40oefbuild/mysql-python/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

marc-fez picture marc-fez  Â·  3Comments

johnjiang picture johnjiang  Â·  3Comments

FooBarQuaxx picture FooBarQuaxx  Â·  3Comments

erinxocon picture erinxocon  Â·  3Comments

leileigong picture leileigong  Â·  3Comments