From when does matplotlib require Visual C++? (Python 3.8.0)

In summary, the speaker encountered an error while trying to install matplotlib on Python 3.8.0. They realized that the installation requires Microsoft Visual C++ 14.0, which they do not have. They question why this is suddenly required and mention that they have successfully installed matplotlib on the old version without Visual C++. They suggest looking into Anaconda distributions as it may not have the Microsoft dependency. They also mention that Anaconda now ships with MS Visual Studio code and tools.
  • #1
Wrichik Basu
Science Advisor
Insights Author
Gold Member
2,138
2,713
I had Python 3.7.3 installed on my laptop. I decided to upgrade to 3.8.0, and after installing all necessary packages, uninstall the old version.

The installation of 3.8.0 was successfully done. With pip, I installed scipy, numpy and sympy. Now when I tried to install matplotlib, it threw an error. It was a large message, so I have attached that as a text file.

This line in the error message caught my eye:
Code:
Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
I don't have Visual C++ installed, simply because I don't use it and won't require it anytime in the near future. The installation is about 1GB, and I am reluctant to install another piece of software just for Python. I already have Matlab student version (which I bought recently), and use that for all my computation work. I have Python only because it is there in my syllabus. And I have somewhat decided to stick to the old version.

The fact is, I have matplotlib installed for the old version of python. It works fine. And I didn't have Visual C++ at that time. Why is Visual C++ required now all of a sudden? Is this a bug or a deliberate feature?
 

Attachments

  • matplotlib_error.txt
    51.8 KB · Views: 242
Last edited:
Technology news on Phys.org
  • #2
Wrichik Basu said:
Why is Visual C++ required now all of a sudden?

I believe it's because Python on Windows needs the build tools supplied with Visual C++ to build certain packages. AFAIK that has been true for many Python releases. It's possible that matplotlib changed how they do Python deployments so that now the build tools are required on Windows where they weren't before; or it's possible that the recent changes in how Python distributions are packaged have impacted matplotlib so that they can't, or haven't yet, build a Windows binary distribution for the version you're installing.
 
  • Like
Likes Wrichik Basu
  • #3
  • Like
Likes Dr Transport

FAQ: From when does matplotlib require Visual C++? (Python 3.8.0)

What is matplotlib and why is Visual C++ relevant?

Matplotlib is a popular Python library used for creating visualizations and plots. Visual C++ is a required dependency for matplotlib because it is used to compile and run the C++ code that matplotlib uses under the hood to create its visualizations.

Is Visual C++ required for all versions of Python?

No, Visual C++ is only required for specific versions of Python, typically versions 3.5 and above. Older versions of Python may require a different compiler, such as Visual Studio 2008 for Python 2.7.

When did matplotlib start requiring Visual C++?

Matplotlib began requiring Visual C++ with the release of version 3.5 in 2015. This was due to changes in the way Python packages were compiled and distributed at the time.

Can I use a different compiler instead of Visual C++ for matplotlib?

While Visual C++ is the recommended compiler for matplotlib, it is possible to use other compilers such as MinGW or Cygwin. However, the process may be more complex and may require additional configuration.

Do I need to install Visual C++ separately for matplotlib?

No, if you have a recent version of Python installed, Visual C++ should also be installed automatically. If you encounter issues with matplotlib, it may be necessary to reinstall or update Visual C++.

Similar threads

Replies
8
Views
1K
Replies
1
Views
1K
Replies
1
Views
1K
Replies
6
Views
1K
Replies
10
Views
3K
Back
Top