Recently, according to the learning tasks assigned by the leader, I started to learn matplotlib in python. My friend told me that this is very simple. However, as soon as I stepped into the installation threshold, I encountered the problem of unsuccessful installation. , and then searched on Baidu, and followed the suggestions of netizens, tried the method, and finally the installation was successful. Although I felt that the installation was successful, the root cause did not seem to be found. Although the various methods from netizens are very effective, I still want to record the journey of getting started this time to remind myself in the future. The road of learning is still long, I hope you will become more courageous as you go. The following is a formal record of the solution to this failed installation of matplotlib:
Different from online installation tutorials, many online tutorials download the installation package from the official website and then execute the installation command, and I Direct online installation, although there is no difference between the two methods, it is safer to install after downloading the installation package. Online installation may cause more problems. This time the installation is also online installation.
First, in the command Enter the installation command in the input box: pip install matplotlib, as shown in the figure:
The above error occurs, although you can probably understand the error. prompt, but according to what we know, it is still not solved, so according to the method of netizens, the problem can be solved by upgrading the pip version and then installing it, as shown in the figure:
Execute the command to upgrade the pip version, prompt The current version is the latest version, as shown in the picture:
Then execute the installation command to install successfully, as shown in the picture:
Recommended tutorial: "Python Tutorial"
The above is the detailed content of How to solve the problem of failure to install matplotlib in python. For more information, please follow other related articles on the PHP Chinese website!