【问题标题】:How to fix `error: invalid command 'bdist_wheel'`?如何修复`错误:无效命令'bdist_wheel'`?
【发布时间】:2021-03-24 03:34:46
【问题描述】:

我尝试在 Ubuntu 20.04.01 上安装 watchman:

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

失败:

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

我找到了解决这个问题的方法:如果我卸载 pywatchman 并安装 wheel 它工作正常。

我想为守望者创建一个补丁,这样就可以直接使用。

如何解决这个问题,以便将来不再发生这种情况?

相关:https://github.com/facebook/watchman/issues/876

【问题讨论】:

标签: python python-wheel watchman


【解决方案1】:

跑步

pip install wheel

pip3 install wheel

帮我解决了问题

【讨论】:

  • 它对我有用。
  • 正确答案!!!
  • 尤其是在虚拟环境中运行时,首先安装轮子使其工作。安装在全局 python 范围内的轮子没有被使用,因此必须先完成。
猜你喜欢
  • 2018-12-07
  • 2023-03-05
  • 1970-01-01
  • 2016-08-29
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-24
  • 1970-01-01
相关资源
最近更新 更多