posted on 2023-06-06 10:31 read(398) comment(0) like(21) collect(2)
To make a long story short: It took me about three and a half hours to download matplotlib and hit the wall repeatedly, and I almost ran away. In order not to let the new friends take my detour, I specially created this article to point out the direction.
1. First you need to download python
I downloaded it directly from the software store that comes with the computer, which is convenient, and of course there is no problem under the official website.
Need to understand that python comes with pip
2. win + R, enter cmd to enter the console, enter the command:
pip --version
check whether there is pip, the following is the situation of pip:
If not, enter the command: python -m ensurepip --default-pip
download one, and you may need to update it after downloading)
3. Update pip (mine is the latest version) and enter the command in cmd:
python.exe -m pip install --upgrade pip
(After the update, you can enter the command in cmd: pip --version
check the version)
4. Change pip from a foreign source to a domestic source (if you don’t change it, the download speed of matplotlib will be very slow, and the connection will be disconnected, so it keeps reporting errors, which is the key point!) (I am defeated here)
Follow this big brother to change it. It really only takes two or three minutes. The personal test is effective and saved me from the heat of the water: 1 minute to set up the pip mirror source
5. Enter the command in cmd:
python -m pip install matplotlib
download matplotlib library
The download process is similar to this:
just wait patiently for a while, if there is any download failure or the like, 90% of them are because you did not complete step 4.
After downloading, you can enter the command in cmd: python -m pip list
see if there is this matplotlib in it
If there is, it means success.
As for wanting to use the drawing module in pycharm, the following brief pictures have been taken:
Open Settings
Open python interperter and click +
3 on the right.
Search for the newly downloaded matpotlib library
and click Install package in the lower left corner to download. After downloading, just find a drawing code copy on the Internet and try it out:
Author:kkkkkkkkkkdsdsd
link:http://www.pythonblackhole.com/blog/article/79680/46648c5d3d0088a64c26/
source:python black hole net
Please indicate the source for any form of reprinting. If any infringement is discovered, it will be held legally responsible.
name:
Comment content: (supports up to 255 characters)
Copyright © 2018-2021 python black hole network All Rights Reserved All rights reserved, and all rights reserved.京ICP备18063182号-7
For complaints and reports, and advertising cooperation, please contact vgs_info@163.com or QQ3083709327
Disclaimer: All articles on the website are uploaded by users and are only for readers' learning and communication use, and commercial use is prohibited. If the article involves pornography, reactionary, infringement and other illegal information, please report it to us and we will delete it immediately after verification!