Can't build wheel - error: invalid command 'bdist_wheel'

烂漫一生 提交于 2019-12-05 02:17:48

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:

  1. python3 -m venv .
  2. . bin/activate
  3. pip install Flask

However, the following does work:

  1. python3 -m venv .
  2. . bin/activate
  3. pip install wheel (never had to do this on, say, Arch Linux)
  4. 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).

One thing to note is that make sure you are using setuptools, not distutils.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!