I've tried everything in this very related question: Why can I not create a wheel in python?
But I still get:
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'
Context:
$ pip --version
pip 8.1.1 from /home/bdillman/proj/fashion/lib/python3.5/site-packages (python 3.5)
$ python -c "import setuptools; print(setuptools.__version__)"
18.2
$ python --version
Python 3.5.1
$ which python
/home/bdillman/workspace/fashion/bin/python
$ pip list
Mako (1.0.4)
MarkupSafe (0.23)
peewee (2.8.0)
pip (8.1.1)
PyYAML (3.11)
setuptools (21.0.0)
wheel (0.29.0)
So it looks like everything is installed and the versions look good (I think). Anyone have ideas of things to check to further the diagnosis here?
The exact command is:
$ python setup.py bdist_wheel
I've also tried
$ sudo python setup.py bdist_wheel
I've also done pip install --upgrade setuptools
and pip install --upgrade wheel
, and they're up-to-date.
python setup.py bdist_wheel. This will build any C extensions in the project and then package those and the pure Python code into a . whl file in the dist directory.
With the latest version of setuptools, the python setup.py install command is being deprecated (see https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for more info).
To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
I had this happen to me on a recent Ubuntu using python3 -m venv
(for which you must install python3-venv
), where no matter how many times I cleared the environment and retried, I was getting bdist_wheel
errors installing the dependencies for Flask.
In addition to not having venv
by default as normal for a Python 3 install, for some reason on Ubuntu I also seem to have to explicitly install wheel
.
For clarity, the following did not work:
python3 -m venv .
. bin/activate
pip install Flask
However, the following does work:
python3 -m venv .
. bin/activate
pip install wheel
(never had to do this on, say, Arch Linux)pip install Flask
Solved it. I'm not sure how, but my python virtual environment was messed up, with pip using a different virtual environment. I fixed my virtual environment and now everything seems to work fine.
I'm new to python and virtual environments, and I think I might've copied a whole project containing a virtual environment, then edited it (and missed some references, say at the top of the pip script).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With