您好,登錄后才能下訂單哦!
python 3.9 Numpy scipy和matlabplot如何在windows環(huán)境中安裝?相信很多沒有經(jīng)驗的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。
1 首先打開cmd
win+r
2 pip安裝
pip3 install --user numpy scipy matplotlib
–user 選項可以設(shè)置只安裝在當(dāng)前的用戶下,而不是寫入到系統(tǒng)目錄。默認(rèn)情況使用國外線路,國外太慢,我們使用清華的鏡像就可以:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
如何網(wǎng)絡(luò)不好,我們可以挨個單獨安裝
pip3 install numpy s -i https://pypi.tuna.tsinghua.edu.cn/simple pip3 install scipy -i https://pypi.tuna.tsinghua.edu.cn/simple pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
3 安裝matlabplot時遇到錯誤:
Using legacy 'setup.py install' for matplotlib, since package 'wheel' is not installed.
Installing collected packages: matplotlib
Running setup.py install for matplotlib ... error
ERROR: Command errored out with exit status 1:
查看自己的python版本:
Python 3.9.0 (tags/v3.9.0:9cf6752, Oct 5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information.
我的python是3.9 AMD64
在https://www.lfd.uci.edu/~gohlke/pythonlibs/網(wǎng)站找到worldcould
選著自己相應(yīng)的.whl下載。我的選:
wordcloud-1.8.0-cp39-cp39-win_amd64.whl
然后回到cmd
4 安裝
pip install wordcloud-1.8.0-cp39-cp39-win_amd64.whl
5 再次出現(xiàn)錯誤
Using legacy 'setup.py install' for matplotlib, since package 'wheel' is not installed.
直接安裝wheel
pip install wheel
6 再次安裝matlabplot
pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
不成功
7 在https://www.lfd.uci.edu/~gohlke/pythonlibs/找到matlabplot
下載后安裝,
pip3 install matplotlib-3.3.2-cp39-cp39-win_amd64.whl
顯示安裝成功,趕緊找個程序來試一下:
import numpy as np from matplotlib import pyplot as plt x = np.arange(1,11) y = 2 * x + 5 plt.title("Matplotlib demo") plt.xlabel("x axis caption") plt.ylabel("y axis caption") plt.plot(x,y) plt.show()
看完上述內(nèi)容,你們掌握python 3.9 Numpy scipy和matlabplot如何在windows環(huán)境中安裝的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。