Study python You want to use python Of matlabplot Drawing function , There are a lot of problems , And then all the way through , Final installation successful , It's not easy , Post in memory of .
win+r
pip3 install --user numpy scipy matplotlib
–user Option can be set to install only under the current user , Instead of writing to the system directory . By default, foreign lines are used , It's too slow abroad , We can use the image of Tsinghua University :
pip3 install numpy scipy matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
How the network is not good , We can install them one by one
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
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: command: 'c:\users\diouf.guo\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Diouf.Guo\\AppData\\Local\\Temp\\pip-install-thjn2jbc\\matplotlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Diouf.Guo\\AppData\\Local\\Temp\\pip-install-thjn2jbc\\matplotlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Diouf.Guo\AppData\Local\Temp\pip-record-kay5nve4\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\diouf.guo\appdata\local\programs\python\python39\Include\matplotlib'
Check out your python edition :
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.
my python yes 3.9 AMD64
stay https://www.lfd.uci.edu/~gohlke/pythonlibs/ Website found worldcould
Choose your own .whl download . My choice :
wordcloud-1.8.0-cp39-cp39-win_amd64.whl
Then back cmd
pip install wordcloud-1.8.0-cp39-cp39-win_amd64.whl
Using legacy 'setup.py install' for matplotlib, since package 'wheel' is not installed.
Direct installation wheel
pip install wheel
pip3 install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple
You don't succeed
Download and install ,
pip3 install matplotlib-3.3.2-cp39-cp39-win_amd64.whl
Show installation success , Find a program to try it out :
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()
Installation successful , A wave of 50% off
This article is from WeChat official account. - FPGA Open source studio (leezym0317)
The source and reprint of the original text are detailed in the text , If there is any infringement , Please contact the [email protected] Delete .
Original publication time : 2020-11-14
Participation of this paper Tencent cloud media sharing plan , You are welcome to join us , share .