亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

在Python中安裝matplotlib的問題

在Python中安裝matplotlib的問題

肥皂起泡泡 2023-10-26 14:25:37
我正在嘗試使用 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.


查看完整回答
反對 回復 2023-10-26
?
侃侃無極

TA貢獻2051條經驗 獲得超10個贊

安裝wheel后,您應該再次運行“pip install matplotlib”。

就我而言,錯誤轉向了pillow安裝,在我成功安裝pillow后,我終于也可以安裝matplotlib了!


查看完整回答
反對 回復 2023-10-26
?
萬千封印

TA貢獻1891條經驗 獲得超3個贊

嘗試

pip install wheel

然后再試一次。


查看完整回答
反對 回復 2023-10-26
?
至尊寶的傳說

TA貢獻1789條經驗 獲得超10個贊

我有同樣的錯誤。運行后,pip install wheel我使用以下--prefer-binary標志運行安裝:

python -m pip install -U matplotlib --prefer-binary.

文檔內容如下:

如果此命令導致 Matplotlib 從源代碼編譯并且編譯出現問題,您可以添加 --prefer-binary 來選擇最新版本的 Matplotlib,該版本有適用于您的操作系統和 Python 的預編譯輪。


查看完整回答
反對 回復 2023-10-26
  • 4 回答
  • 0 關注
  • 215 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號