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

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

Related

FastAPI "ERROR: Failed building wheel for python-multipart" in basic "hello world" tutorial

I follow the FastAPI "hello world" tutorial. As step 1, I need to run (I use python 3.8 in a venv):
pip install "fastapi[all]"
but I get:
Building wheels for collected packages: python-multipart
Building wheel for python-multipart (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: venv/my_venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u0lo92at/python-multipart/setup.py'"'"'; __file__='"'"'/tmp/pip-install-u0lo92at/python-multipart/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-f5_nolf4
cwd: /tmp/pip-install-u0lo92at/python-multipart/
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 python-multipart
Running setup.py clean for python-multipart
Failed to build python-multipart
When I go over to step 2, it says:
$ uvicorn main:app --reload
Command 'uvicorn' not found, but can be installed with:
sudo apt install uvicorn
although uvicorn is said to be installed with the command in the first place:
What should I do to run uvicorn main:app --reload?
Just install it again.
pip install "fastapi[all]"
Afterwards, you can run
uvicorn main:app --reload
without further installations.

unable to install autotest in ubuntu environment

I am trying to install autotest in ubuntu environment.
$ pip3 install autotest==0.16.4
After I execute I get the following error:
python3 -m pip install autotest==0.16.4
Defaulting to user installation because normal site-packages is not writeable
Collecting autotest==0.16.4
Using cached autotest-0.16.4.tar.gz (11.3 MB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-cw5xzm8k/autotest/setup.py'"'"'; __file__='"'"'/tmp/pip-install-cw5xzm8k/autotest/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-8yy0dvmj
cwd: /tmp/pip-install-cw5xzm8k/autotest/
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 'egg_info'
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
$ python3 --version
Python 3.7.8
$ pip -V
pip 20.1.1 from /home/ubuntu/.local/lib/python3.7/site-packages/pip (python 3.7)
try:
sudo pip3 install autotest==0.16.4
The error is that it cannot write to destination, most probably due to permissions.

Can't install dev-setup of hyperledger indy-node

I am trying to install dev-setup on my system using this link
https://github.com/hyperledger/indy-node/blob/master/docs/source/setup-dev.md
as guide i followed all steps now while executing command pip install -e .[tests] I getting error: failed to build wheels for leveldb, ujson, python-rocksdb, sha3, psutil, orderedset..
I tried python3 setup.py bdist_wheel this command executes but then i am not able to run next command
Building wheels for collected packages: leveldb, ujson, python-rocksdb, sha3, psutil, orderedset
Building wheel for leveldb (setup.py) ... error
ERROR: Complete output from command /home/richa/test/bin/python3.5 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-cwvzh10g/leveldb/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-ufgtvm7j --python-tag cp35:
ERROR: running bdist_wheel
Steps that are easy to miss in that guide include:
Activating the virtual environment with source activate
Installing wheel with pip install wheel

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

Categories