1. 程式人生 > >【已解決】安裝pyleus遇到的'bdist_wheel'錯誤

【已解決】安裝pyleus遇到的'bdist_wheel'錯誤

今天用pip命令安裝pyleus時遇到以下錯誤
  Failed building wheel for PyYAML
  Running setup.py bdist_wheel for msgpack-python
  Complete output from command /usr/bin/python -c "import setuptools;__file__='/tmp/pip-build-685OEx/msgpack-python/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpUJDHTSpip-wheel-:
  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'
 
查了下bdist_wheel,發現似乎是pip的一個子命令,wheel本質上是一種zip包,用於py模組的安裝,它的出現是為了替代Eggs。

嘗試執行pip wheel,果然有告錯

ERROR: 'pip wheel' requires setuptools >= 0.8 for dist-info support. To fix this, run: pip install --upgrade setuptools

於是根據它的建議,升級pip的安裝工具setuptools ,命令是
sudo pip install --upgrade setuptools
再試,出現如下資訊
[
[email protected]
etc]$ pip wheel
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
You must give at least one requirement to wheel (see "pip help wheel")


我不確定pip本身升級是不是必要,讀者可以試一試不升級而直接安裝pyleus

升級pip完畢,嘗試pip安裝pyleus,啊,提示已存在。那麼先uninstall,再安裝
一陣等待……後,ok搞定