Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when running pip install: python setup.py egg_info" failed with error code 1 #370

Closed
schalkneethling opened this issue Jun 7, 2018 · 30 comments

Comments

@schalkneethling
Copy link

commented Jun 7, 2018

Have tries a couple of times now, but each time the result is the same:

pip install python-language-server
Collecting python-language-server
  Downloading https://files.pythonhosted.org/packages/97/4c/b561716780888f8df9ed44b5e2b8b499258c31b7722d96da0002483fcdd2/python-language-server-0.19.0.tar.gz (55kB)
    100% |████████████████████████████████| 61kB 150kB/s
    Complete output from command python setup.py egg_info:
    error in python-language-server setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Expected version spec in configparser; python_version<"3.0" at ; python_version<"3.0"

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-install-5Zy4C7/python-language-server/

Not sure if it is an XCode thing or perhaps the version of Python.

OS: macOS High Sierra v10.13.4
Python: 2.7.10

@gatesn

This comment has been minimized.

Copy link
Collaborator

commented Jun 7, 2018

Please update setup tools pip install -U setuptools

@gatesn gatesn closed this Jun 7, 2018

@schalkneethling

This comment has been minimized.

Copy link
Author

commented Jun 7, 2018

Oh ow, that is causing an even bigger error :-/

pip install -U setuptools
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl (567kB)
    100% |████████████████████████████████| 573kB 635kB/s
Installing collected packages: setuptools
  Found existing installation: setuptools 18.5
    Uninstalling setuptools-18.5:
Could not install packages due to an EnvironmentError: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/private/var/folders/l1/mjqxjq7j08jb6z6_f7j5wcgw0000gn/T/pip-uninstall-HGTmWv/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

Any suggestions? Thanks a lot

@schalkneethling

This comment has been minimized.

Copy link
Author

commented Jun 7, 2018

Hmmm, tried sudo and sudo -H but pretty much the same:

sudo -H pip install -U setuptools
Collecting setuptools
  Downloading https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl (567kB)
    100% |████████████████████████████████| 573kB 463kB/s
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: setuptools
  Found existing installation: setuptools 18.5
    Uninstalling setuptools-18.5:
Could not install packages due to an EnvironmentError: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/private/tmp/pip-uninstall-3xJsCH/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]
@gatesn

This comment has been minimized.

Copy link
Collaborator

commented Jun 9, 2018

@schalkneethling

This comment has been minimized.

Copy link
Author

commented Jun 9, 2018

@gatesn Did this previously, so I did brew reinstall python

Here is the output of that:

==> Reinstalling python
==> Installing dependencies for python: sqlite
==> Installing python dependency: sqlite
==> Downloading https://homebrew.bintray.com/bottles/sqlite-3.24.0.high_sierra.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/a5/a51a1d0a22f6648b41980363dae433223785b55cf62bd9c67a78c15eadad7a99?__gda__=ex
######################################################################## 100.0%
==> Pouring sqlite-3.24.0.high_sierra.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides an older sqlite3.

If you need to have this software first in your PATH run:
  echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/sqlite/lib
    CPPFLAGS: -I/usr/local/opt/sqlite/include

==> Summary
🍺  /usr/local/Cellar/sqlite/3.24.0: 11 files, 3.5MB
==> Installing python
==> Downloading https://homebrew.bintray.com/bottles/python-3.6.5.high_sierra.bottle.1.tar.gz
Already downloaded: /Users/schalkneethling/Library/Caches/Homebrew/python-3.6.5.high_sierra.bottle.1.tar.gz
==> Pouring python-3.6.5.high_sierra.bottle.1.tar.gz
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/loca
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/loca
==> /usr/local/Cellar/python/3.6.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/usr/loca
==> Caveats
Python has been installed as
  /usr/local/bin/python3

Unversioned symlinks `python`, `python-config`, `pip` etc. pointing to
`python3`, `python3-config`, `pip3` etc., respectively, have been installed into
  /usr/local/opt/python/libexec/bin

If you need Homebrew's Python 2.7 run
  brew install python@2

Pip, setuptools, and wheel have been installed. To update them run
  pip3 install --upgrade pip setuptools wheel

You can install Python packages with
  pip3 install <package>
They will install into the site-package directory
  /usr/local/lib/python3.6/site-packages

See: https://docs.brew.sh/Homebrew-and-Python

The did echo 'export PATH="/usr/local/opt/sqlite/bin:$PATH"' >> ~/.zshrc

Then did: pip3 install --upgrade pip setuptools wheel and got

Cache entry deserialization failed, entry ignored
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (10.0.1)
Cache entry deserialization failed, entry ignored
Collecting setuptools
  Using cached https://files.pythonhosted.org/packages/7f/e1/820d941153923aac1d49d7fc37e17b6e73bfbd2904959fffbad77900cf92/setuptools-39.2.0-py2.py3-none-any.whl
Cache entry deserialization failed, entry ignored
Collecting wheel
  Using cached https://files.pythonhosted.org/packages/81/30/e935244ca6165187ae8be876b6316ae201b71485538ffac1d718843025a9/wheel-0.31.1-py2.py3-none-any.whl
Installing collected packages: setuptools, wheel
  Found existing installation: setuptools 39.0.1
    Uninstalling setuptools-39.0.1:
      Successfully uninstalled setuptools-39.0.1
  Found existing installation: wheel 0.31.0
    Uninstalling wheel-0.31.0:
      Successfully uninstalled wheel-0.31.0
  Rolling back uninstall of wheel
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/bin/wheel'
Consider using the `--user` option or check the permissions.

So I did: sudo pip3 install --upgrade pip setuptools wheel and got

The directory '/Users/schalkneethling/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/schalkneethling/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Requirement already up-to-date: pip in /usr/local/lib/python3.6/site-packages (10.0.1)
Requirement already up-to-date: setuptools in /usr/local/lib/python3.6/site-packages (39.2.0)
Requirement already up-to-date: wheel in /usr/local/lib/python3.6/site-packages (0.31.1)

Then did sudo pip3 install python-language-server

And it seems to have worked:

The directory '/Users/schalkneethling/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/schalkneethling/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting python-language-server
  Downloading https://files.pythonhosted.org/packages/97/4c/b561716780888f8df9ed44b5e2b8b499258c31b7722d96da0002483fcdd2/python-language-server-0.19.0.tar.gz (55kB)
    100% |████████████████████████████████| 61kB 1.1MB/s
Collecting future>=0.14.0 (from python-language-server)
  Downloading https://files.pythonhosted.org/packages/00/2b/8d082ddfed935f3608cc61140df6dcbf0edea1bc3ab52fb6c29ae3e81e85/future-0.16.0.tar.gz (824kB)
    100% |████████████████████████████████| 829kB 3.3MB/s
Collecting jedi>=0.12 (from python-language-server)
  Downloading https://files.pythonhosted.org/packages/e7/42/074192a165622e645ed4aeade63e76e56b3496a044569b3c6cae3a918352/jedi-0.12.0-py2.py3-none-any.whl (172kB)
    100% |████████████████████████████████| 174kB 3.9MB/s
Collecting pluggy (from python-language-server)
  Downloading https://files.pythonhosted.org/packages/ba/65/ded3bc40bbf8d887f262f150fbe1ae6637765b5c9534bd55690ed2c0b0f7/pluggy-0.6.0-py3-none-any.whl
Collecting parso>=0.2.0 (from jedi>=0.12->python-language-server)
  Downloading https://files.pythonhosted.org/packages/cd/3e/5908f9577dbd1e5df53e64349bfd11e46b726c1e4d8cd676bbe8aa4de316/parso-0.2.1-py2.py3-none-any.whl (91kB)
    100% |████████████████████████████████| 92kB 2.4MB/s
Installing collected packages: future, parso, jedi, pluggy, python-language-server
  Running setup.py install for future ... done
  Running setup.py install for python-language-server ... done
Successfully installed future-0.16.0 jedi-0.12.0 parso-0.2.1 pluggy-0.6.0 python-language-server-0.19.0
@Muthu2093

This comment has been minimized.

Copy link

commented Sep 18, 2018

Great.... I faced a similar issue while installing mysqlclient for python
sudo pip3 install MySQL client

Issue Resolved

@shreyashk09

This comment has been minimized.

Copy link

commented Oct 2, 2018

In order to connect to mysql from python (mine 3.7) (import mysql.connector), I used 'pip install mysql-connector-python'. Worked for me

@Kundan-Rwanda

This comment has been minimized.

Copy link

commented Oct 19, 2018

Thanks @shreyashk09 for me also 'pip install mysql-connector-python' worked

@jokinen77

This comment has been minimized.

Copy link

commented Nov 2, 2018

I had this problem when I tried to install xgboost-lib in virtual environment on mac. I was able to install it in first time but then second time I had this problem. I did the same as schalkneethling commented on 9 Jun but it didn't work. Then I renamed /Library/Developer/CommandLineTools folder and installed xcode command line tools again.

xcode-select --install

This worked for me. I don't know if it was only the reinstalling command line tools or was it because of both.

@ytustc

This comment has been minimized.

Copy link

commented Dec 6, 2018

I have a seem question when i install minepy ,and then i try they way you did ,finally success,thank u
here is my code
sudo pip3 install --upgrade pip setuptools wheel
sudo pip3 install minepy

@ghost

This comment has been minimized.

Copy link

commented Dec 21, 2018

Using conda, mine was fixed by executing:
conda install shapely
If you are using pip try:
pip install shapely

@anujgautam11

This comment has been minimized.

Copy link

commented Dec 23, 2018

I had the same issue with pip. Executing: sudo python -m pip install scipy worked for me

@bjxgcl

This comment has been minimized.

Copy link

commented Jan 5, 2019

xcode-select --install
worked for me

@serome111

This comment has been minimized.

Copy link

commented Jan 7, 2019

una imagen de docker es la solución, con eso te ahorras errores internos que tiene mac con las actualizaciones de herramientas de python

@unnir

This comment has been minimized.

Copy link

commented Jan 27, 2019

with conda you can do this:

conda install py-xgboost

@Shragkd

This comment has been minimized.

Copy link

commented Feb 13, 2019

I am trying to install pyradar in ubuntu 18.04 with python 3.6 using pip

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-itd9hctk/pyradar/ is the error I am getting.

I have updated setuptools and development packages too. Please help

@Umair4345

This comment has been minimized.

Copy link

commented Feb 25, 2019

Hello can someone please help me with this. I have tried everything mentioned above but the error doesn't go away.

Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/8z/gpqdyh8x14ddw7p75n63wzkh0000gn/T/pip-install-45NKk3/psycopg2/

@Anonymous1845973

This comment has been minimized.

Copy link

commented Mar 1, 2019

Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-install-44321s9y/distribute/

@tongpinmo

This comment has been minimized.

Copy link

commented Mar 10, 2019

when i do thid command:
pip2 install -U scikit-image
the problem is 👍
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-wt8Rvr/matplotlib/
i don't konw why?

@LK2018

This comment has been minimized.

Copy link

commented Mar 24, 2019

when i do thid command:
pip2 install -U scikit-image
the problem is
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-wt8Rvr/matplotlib/
i don't konw why?

i am also this question

@ch21

This comment has been minimized.

Copy link

commented Apr 14, 2019

I used pip install psycopg2-binary
and it worked for me. thanks for the help guys.

@steve7158

This comment has been minimized.

Copy link

commented May 3, 2019

For me the problem was while installing psycopg2
Sollution:
For python 2:
sudo apt-get install libpq-dev python-dev
For python 3
sudo apt-get install libpq-dev python3-dev

@udothemath1984

This comment has been minimized.

Copy link

commented May 4, 2019

Please try "xcode-select --install" as mentioned by @bjxgcl

It also works for me.

@maaaslani11

This comment has been minimized.

Copy link

commented May 6, 2019

Help please I am a new user of python, and I try to install "scikit-spectra" with this; "sudo python3 -m pip install scikit-spectra" I got the error as " ERROR: Complete output from command python setup.py egg_info:
ERROR: Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-install-cv_doa98/scikit-spectra/setup.py", line 16, in
with open('requirements.txt', 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-cv_doa98/scikit-spectra/"

Any suggestions? Thanks...

@yuliansen

This comment has been minimized.

Copy link

commented May 29, 2019

Help i was trying to clone pip install git+https://github.com/zhangchiyu10/pyC45.git , and ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\YULIAN~1\AppData\Local\Temp\pip-req-build-_iw_ga7h
i have updated my setup to the latest, and nothing changes. help what should i do

@prem2017

This comment has been minimized.

Copy link

commented Jun 10, 2019

I have a seem question when i install minepy ,and then i try they way you did ,finally success,thank u
here is my code
sudo pip3 install --upgrade pip setuptools wheel
sudo pip3 install minepy

This did it for me.

@shinabarger

This comment has been minimized.

Copy link

commented Jun 13, 2019

I have a seem question when i install minepy ,and then i try they way you did ,finally success,thank u
here is my code
sudo pip3 install --upgrade pip setuptools wheel
sudo pip3 install minepy

Tried so many things and this finally worked. thank you!!

@YashithChanuka

This comment has been minimized.

Copy link

commented Jun 18, 2019

sudo pip3 install mysql-connector-python
This command worked for me.

@acctn

This comment has been minimized.

Copy link

commented Jun 25, 2019

pip3 install python-openstackclient

@m0caa

This comment has been minimized.

Copy link

commented Aug 29, 2019

Please update setup tools pip install -U setuptools

I tried that and many other so many times. Won't work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.