I tried to install matplotlib using pip, but the installation failed. After lowering the Python version, the installation was successful.
Windows 10 64bit Python 3.8.0 (→ 3.7.3 described later)
I created a program using Python, Pandas, Numpy, and matplotlib on my regular PC (PC1), and it worked normally. I had to run it on another PC (PC2) and had Python and each library installed on my PC2.
Python 3.8.0 has been successfully installed with the official exe installer. Installation of Pandas and Numpy is completed normally from pip (when Pandas is installed, Numpy is also installed).
When I tried to install matplotlib with the following command, the installation failed with an error.
C:\Users\[Username]>pip install matplotlib
(Omitted)
Installing collected packages: matplotlib
Running setup.py install for matplotlib ... error
ERROR: Command errored out with exit status 1:
(Omitted)
error: Microsoft Visual C++ 14.0 is required.
(Omitted)
By the way, after the line of Running setup.py install, it was displayed in red.
First of all, I had a hard time finding Microsoft Visual C ++. Even if I try to put something like that, the error does not change ...
After that, I tried to install Build Tools for Visual Studio 2017 by referring to the following article.
https://qiita.com/white0221/items/b48f1b64dbd810e21702
As a result, the error message changed as follows. However, the point that the error has occurred remains unchanged.
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.23.28105\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
Furthermore, as a result of continuing a google search for "matplotlib error status 1" and "matplotlib installation error", I found the following questions and answers.
https://teratail.com/questions/219050
I uninstalled Python 3.8.0, installed Python 3.7.3, and then installed matplotlib via pip, and it was so easy that I couldn't beat it!
Use the stable version anyway!
Recommended Posts