windows下python 3.9 Numpy scipy和matlabplot的安裝教程詳解
學(xué)習(xí)python過(guò)程中想使用python的matlabplot繪圖功能,遇到了一大批問(wèn)題,然后一路過(guò)關(guān)斬將,最終安裝成功,實(shí)為不易,發(fā)帖留念。
1 首先打開(kāi)cmd
win+r
2 pip安裝
pip3 install --user numpy scipy matplotlib
?user 選項(xiàng)可以設(shè)置只安裝在當(dāng)前的用戶(hù)下,而不是寫(xiě)入到系統(tǒng)目錄。默認(rèn)情況使用國(guó)外線(xiàn)路,國(guó)外太慢,我們使用清華的鏡像就可以:
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
如何網(wǎng)絡(luò)不好,我們可以挨個(gè)單獨(dú)安裝
pip3 install numpy s -i https://pypi.tuna.tsinghua.edu.cn/simplepip3 install scipy -i https://pypi.tuna.tsinghua.edu.cn/simplepip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
3 安裝matlabplot時(shí)遇到錯(cuò)誤:
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)錯(cuò)誤
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
顯示安裝成功,趕緊找個(gè)程序來(lái)試一下:
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()
安裝成功,一波五折
到此這篇關(guān)于windows下python 3.9 Numpy scipy和matlabplot的安裝教程詳解的文章就介紹到這了,更多相關(guān)python 3.9 Numpy scipy和matlabplot的安裝內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!
相關(guān)文章:
1. Django ORM實(shí)現(xiàn)按天獲取數(shù)據(jù)去重求和例子2. 解決ajax的delete、put方法接收不到參數(shù)的問(wèn)題方法3. asp知識(shí)整理筆記4(問(wèn)答模式)4. IntelliJ IDEA 統(tǒng)一設(shè)置編碼為utf-8編碼的實(shí)現(xiàn)5. 詳解idea中web.xml默認(rèn)版本問(wèn)題解決6. chat.asp聊天程序的編寫(xiě)方法7. IntelliJ IDEA 2020最新激活碼(親測(cè)有效,可激活至 2089 年)8. Jsp中request的3個(gè)基礎(chǔ)實(shí)踐9. jsp EL表達(dá)式詳解10. 怎樣才能用js生成xmldom對(duì)象,并且在firefox中也實(shí)現(xiàn)xml數(shù)據(jù)島?
