我正在嘗試使用 python 3.9 在 windows x64 中安裝 matplotlib。當我做:pip 安裝 matplotlib我收到此錯誤:ERROR: Command errored out with exit status 1: command: 'c:\program files\python39\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-zlfu5f08\\kiwisolver\\setup.py'"'"'; __file__='"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-install-zlfu5f08\\kiwisolver\\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 'C:\Users\Luca\AppData\Local\Temp\pip-pip-egg-info-mriih1bh' cwd: C:\Users\Luca\AppData\Local\Temp\pip-install-zlfu5f08\kiwisolver\Complete output (44 lines):WARNING: The wheel package is not available. ERROR: Command errored out with exit status 1: command: 'c:\program files\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-wheel-pvxhkv11\\cppy\\setup.py'"'"'; __file__='"'"'C:\\Users\\Luca\\AppData\\Local\\Temp\\pip-wheel-pvxhkv11\\cppy\\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 'C:\Users\Luca\AppData\Local\Temp\pip-wheel-1s8s6o5r' cwd: C:\Users\Luca\AppData\Local\Temp\pip-wheel-pvxhkv11\cppy\ 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我嘗試遵循我在這里找到的所有建議,但它仍然會生成錯誤。請問誰可以幫助我?
4 回答

慕姐8265434
TA貢獻1813條經驗 獲得超2個贊
從堆棧跟蹤來看,好像車輪沒有安裝
嘗試以下操作
pip install wheel
然后運行
python setup.py bdist_wheel
根據文檔PIP 輪
Build?System?Interface? In?order?for?pip?to?build?a?wheel,?setup.py? must?implement?the?bdist_wheel?command?with?the?following?syntax: python?setup.py?bdist_wheel?-d?TARGET This?command?must?create?a?wheel?compatible?with?the? invoking?Python?interpreter,?and?save?that?wheel?in?the? directory?TARGET. No?other?build?system?commands?are?invoked?by?the?pip?wheel?command.

侃侃無極
TA貢獻2051條經驗 獲得超10個贊
安裝wheel后,您應該再次運行“pip install matplotlib”。
就我而言,錯誤轉向了pillow安裝,在我成功安裝pillow后,我終于也可以安裝matplotlib了!

至尊寶的傳說
TA貢獻1789條經驗 獲得超10個贊
我有同樣的錯誤。運行后,pip install wheel
我使用以下--prefer-binary
標志運行安裝:
python -m pip install -U matplotlib --prefer-binary
.
文檔內容如下:
如果此命令導致 Matplotlib 從源代碼編譯并且編譯出現問題,您可以添加 --prefer-binary 來選擇最新版本的 Matplotlib,該版本有適用于您的操作系統和 Python 的預編譯輪。
添加回答
舉報
0/150
提交
取消