A story about installing matplotlib using pip with an error

wrap up

I tried to install matplotlib using pip, but the installation failed. After lowering the Python version, the installation was successful.

environment

Windows 10 64bit Python 3.8.0 (→ 3.7.3 described later)

background

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.

Event

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.

Correspondence

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!

What i learned

Use the stable version anyway!

Recommended Posts

A story about installing matplotlib using pip with an error
Error when installing a module with Python pip
A memorandum when an error occurs with pip install
A story about an amateur making a breakout with python (kivy) ②
A story about an amateur making a breakout with python (kivy) ①
A story about using Python's reduce
A story about an error when loading a TensorFlow model created with Google Colab locally
A story about machine learning with Kyasuket
A workaround when installing pyAudio with pip.
A story about a 503 error on Heroku open
A story about implementing a login screen with django
[Note] A story about not being able to break through a proxy with pip
A story about building an IDE environment with WinPython on an old Windows OS.
A story about making an x86 bootloader that can boot vmlinux with Rust
Installing packages with pip3
A memorandum about matplotlib
Error with pip install
A story about predicting exchange rates with Deep Learning
A story about making Hanon-like sheet music with Python
A story about trying a (Golang +) Python monorepo with Bazel
A story about how theano was moved with TSUBAME 2.0
I got an error when using Tensorboard with Pytorch
A story about stumbling through PATH after installing anaconda
A story about how Windows 10 users created an environment to use OpenCV3 with Python 3.5
I got a Value Error when using JUMAN ++ with PyKNP
A story about competing with a friend in Othello AI Preparation
A story that stumbled when using pip in a proxy environment
After installing CentOS8 with VirtualBox, an error occurs when restarting
Using a printer with Debian 10
A story about how to deal with the CORS problem
Machine learning A story about people who are not familiar with GBDT using GBDT in Python
A story about a war when two newcomers developed an app
A story about making a tanka by chance with Sudachi Py
polyfit error when installing matplotlib
A story about a python beginner stuck with No module named'http.server'
What to do if pip --user returns an error in a virtual environment created with pyenv
A story about adding a REST API to a daemon made with Python
The story that a hash error came out when using Pipenv
# Solution when pip install gives an error when using Anaconda on Windows 10
I get an error when trying to install maec 4.0.1.0 with pip
A story about a build error in a shared library that references libusb
A story about developing a soft type with Firestore + Python + OpenAPI + Typescript
Error with pip: There was a problem confirming the ssl certificate
A python graphing manual with Matplotlib.
Japaneseize Matplotlib with Alpine using Docker
Draw a loose graph with matplotlib
Write a stacked histogram with matplotlib
Using a webcam with Raspberry Pi
[Small story] How to save matplotlib graphs in a batch with Jupyter
How about creating a virtual environment with Anaconda and doing pip install?
A story about automating online mahjong (Mahjong Soul) with OpenCV and machine learning
I got an SSL related error with pip install, so I solved it
A story about creating an anonymous channel on Slack from zero knowledge
A story about trying to connect to MySQL using Heroku and giving up
A story about deploying a Twitter-linked app created using Flask + gunicorn on Heroku
A story about converting HTML to PDF with WeasyPrint + matplotlib and embedding graphs [Beginners learn python with a reference book]
I get an error with import pandas.
SSL certificate related with pip install? Error
A story about remodeling Lubuntu into a Chromebook
About package management with conda and pip
How to draw a graph using Matplotlib