Error installing with pip - python

Trying to uninstall a package installed with pip, I uninstall some and now pip don't work. I try to install pandas:
[sudo] pip install pandas
And this is the error:
Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/lib/python2.7/dist-packages
Requirement already satisfied (use --upgrade to upgrade): python-dateutil in /usr/local/lib/python2.7/dist-packages (from pandas)
Downloading/unpacking pytz (from pandas)
Downloading pytz-2013b.zip (535kB): 535kB downloaded
Running setup.py egg_info for package pytz
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'zip_safe'
warnings.warn(msg)
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-root/pytz
Storing complete log in /root/.pip/pip.log
I have Linux Mint Mate 15. How I can resolve this??

Update your setuptools installation with pip install -U setuptools.

Try installing distribute with pip install distribute.

Related

How to fix `error: invalid command 'bdist_wheel'`?

I try to install watchman on Ubuntu 20.04.01:
guettli#yoga15:~/tmp$ python3 -m venv pywatchman-test
guettli#yoga15:~/tmp$ cd pywatchman-test
guettli#yoga15:~/tmp/pywatchman-test$ . bin/activate
(pywatchman-test) guettli#yoga15:~/tmp/pywatchman-test$ pip install pywatchman
Fails:
Collecting pywatchman
Using cached pywatchman-1.4.1.tar.gz (29 kB)
Building wheels for collected packages: pywatchman
Building wheel for pywatchman (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /home/guettli/tmp/pywatchman-test/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-on_zbadt/pywatchman/setup.py'"'"'; __file__='"'"'/tmp/pip-install-on_zbadt/pywatchman/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-9np2rv_b
cwd: /tmp/pip-install-on_zbadt/pywatchman/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for pywatchman
Running setup.py clean for pywatchman
Failed to build pywatchman
Installing collected packages: pywatchman
Running setup.py install for pywatchman ... done
Successfully installed pywatchman-1.4.1
I found a way to solve this: If I uninstall pywatchman and install wheel it works fine.
I would like to create a patch for watchman, so that this works right of the box.
How could this be solved, so that in future this does not happen any more?
Related: https://github.com/facebook/watchman/issues/876
Running
pip install wheel
or
pip3 install wheel
or
python3 -m pip install wheel
solved the issue for me

Python Flask Install - Are these errors bad?

When installing Flask I get errors but it still says successful. Are these errors going to cause problems for me?
Using Python3 on Debian 9
I tried upgrading setuptools, but still get the same errors.
Collecting flask
Using cached Flask-0.12.2-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from flask)
Using cached itsdangerous-0.24.tar.gz
Collecting Werkzeug>=0.7 (from flask)
Using cached Werkzeug-0.12.2-py2.py3-none-any.whl
Collecting click>=2.0 (from flask)
Using cached click-6.7-py2.py3-none-any.whl
Collecting Jinja2>=2.4 (from flask)
Using cached Jinja2-2.10-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from Jinja2>=2.4->flask)
Using cached MarkupSafe-1.0.tar.gz
Building wheels for collected packages: itsdangerous, MarkupSafe
Running setup.py bdist_wheel for itsdangerous ... error
Complete output from command /home/ev/Desktop/DNIT/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-blrz3kyb/itsdangerous/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmprpoc62sipip-wheel- --python-tag cp35:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for itsdangerous
Running setup.py clean for itsdangerous
Running setup.py bdist_wheel for MarkupSafe ... error
Complete output from command /home/ev/Desktop/DNIT/venv/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-blrz3kyb/MarkupSafe/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmp8419jrrypip-wheel- --python-tag cp35:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for MarkupSafe
Running setup.py clean for MarkupSafe
Failed to build itsdangerous MarkupSafe
Installing collected packages: itsdangerous, Werkzeug, click, MarkupSafe, Jinja2, flask
Running setup.py install for itsdangerous ... done
Running setup.py install for MarkupSafe ... done
Successfully installed Jinja2-2.10 MarkupSafe-1.0 Werkzeug-0.12.2 click-6.7 flask-0.12.2 itsdangerous-0.24
this is how a solve the problem
pip install wheel
you can remove the venv folder and restart like this
python3 -m venv ./venv
pip install wheel
pip install flask
this will solve the problem

Error installing PayPalRESTSDK on Raspberry Pi

I'm trying to install the paypalrestsdk on a Raspberry Pi but I'm getting a huge error list:
$ pip install paypalrestsdk
Collecting paypalrestsdk
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning.
SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Using cached paypalrestsdk-1.11.5.tar.gz
Collecting requests>=1.0.0 (from paypalrestsdk)
Using cached requests-2.9.1-py2.py3-none-any.whl
Collecting six>=1.0.0 (from paypalrestsdk)
Using cached six-1.10.0-py2.py3-none-any.whl
Collecting pyopenssl>=0.15 (from paypalrestsdk)
Using cached pyOpenSSL-0.15.1-py2.py3-none-any.whl
Collecting cryptography>=0.7 (from pyopenssl>=0.15->paypalrestsdk)
Using cached cryptography-1.2.3.tar.gz
Collecting idna>=2.0 (from cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached idna-2.0-py2.py3-none-any.whl
Collecting pyasn1>=0.1.8 (from cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached pyasn1-0.1.9-py2.py3-none-any.whl
Collecting setuptools>=1.0 (from cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached setuptools-20.2.2-py2.py3-none-any.whl
Collecting enum34 (from cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached enum34-1.1.2.tar.gz
Collecting ipaddress (from cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached ipaddress-1.0.16-py27-none-any.whl
Collecting cffi>=1.4.1 (from cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached cffi-1.5.2.tar.gz
Collecting pycparser (from cffi>=1.4.1->cryptography>=0.7->pyopenssl>=0.15->paypalrestsdk)
Using cached pycparser-2.14.tar.gz
Building wheels for collected packages: paypalrestsdk, cryptography, enum34, cffi, pycparser
Running setup.py bdist_wheel for paypalrestsdk ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-QDhj0w/paypalrestsdk/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpUHqkenpip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for paypalrestsdk
Running setup.py clean for paypalrestsdk
Running setup.py bdist_wheel for cryptography ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-QDhj0w/cryptography/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpI47_Acpip-wheel- --python-tag cp27:
Installed /tmp/pip-build-QDhj0w/cryptography/cffi-1.5.2-py2.7-linux-armv7l.egg
Searching for pycparser
Reading http://pypi.python.org/simple/pycparser/
Best match: pycparser 2.14
Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.14.tar.gz#md5=a2bc8d28c923b4fe2b2c3b4b51a4f935
Processing pycparser-2.14.tar.gz
Running pycparser-2.14/setup.py -q bdist_egg --dist-dir /tmp/easy_install-jMojU6/pycparser-2.14/egg-dist-tmp-ZE49md
warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
warning: no previously-included files matching 'lextab.*' found under directory 'tests'
warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
warning: no previously-included files matching 'lextab.*' found under directory 'examples'
zip_safe flag not set; analyzing archive contents...
Installed /tmp/pip-build-QDhj0w/cryptography/pycparser-2.14-py2.7.egg
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for cryptography
Running setup.py clean for cryptography
Running setup.py bdist_wheel for enum34 ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-QDhj0w/enum34/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpt43mirpip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for enum34
Running setup.py clean for enum34
Running setup.py bdist_wheel for cffi ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-QDhj0w/cffi/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmp0x88PWpip-wheel- --python-tag cp27:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
This continues for a while so I've withheld the later bits.
Will paypalrestsdk run on a raspberry pi and what do I need to do to facilitate it?
#Cdarke has identified the issue correctly above but upgrading the Rapsberry Pi to 2.7.11 took some time. Here is a good tutorial

Unable to install MySQL-python " invalid command 'egg_info' "

I'm getting a weird error after running
$ pip install mysql-python
Has anyone seen an error like this with "egg_info" being invalid?
I'm running OSX mountain lion
Downloading/unpacking MySQL-python
Using download cache from /Users/Marcus/.pip/cache/https%3A%2F%2Fpypi.python.org%2Fpackages%2Fsource%2FM%2FMySQL-python%2FMySQL-python-1.2.4.zip
Running setup.py egg_info for package MySQL-python
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6
Now working in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6/distribute-0.6.28
Building a Distribute egg in /Users/Marcus/sites/venv/build/MySQL-python
/Users/Marcus/sites/venv/build/MySQL-python/distribute-0.6.28-py2.7.egg
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz
Extracting in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6
Now working in /var/folders/ss/nxvs3w690xqbpvr_l0v31mrw0000gn/T/tmpg_MvY6/distribute-0.6.28
Building a Distribute egg in /Users/Marcus/sites/venv/build/MySQL-python
/Users/Marcus/sites/venv/build/MySQL-python/distribute-0.6.28-py2.7.egg
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /Users/Marcus/sites/venv/build/MySQL-python
Storing complete log in /Users/Marcus/.pip/pip.log
Thanks
--- I'm getting this same error when I run
$ pip install django
You need distribute package which is now inside setuptools:
pip install --upgrade setuptools

python, trouble installing with pip

I am trying to instal the python version of openGL on my mac. When I use the command given by the site pip install PyOpenGL PyOpenGL_accelerate I get:
Downloading/unpacking PyOpenGL
Downloading PyOpenGL-3.1.0a3.tar.gz (939kB): 939kB downloaded
Running setup.py egg_info for package PyOpenGL
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
Complete output from command python setup.py egg_info:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'egg_info'
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /private/var/folders/2m/chhqrrdn6698hyx3mt1gtcg00000gp/T/pip-build-lego90511/PyOpenGL
Storing complete log in /Users/lego90511/Library/Logs/pip.log
After some searching, most people tend to be missing some utility or another, but it is never the same thing. So what am I missing?

Categories