import matplotlib on PyCharm: Quick 3 min solution

Students trying to import the package “matplotlib” on PyCharm will soon face the cryptic error message: “Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework.”

It is extremely puzzling what to do. I have researched the steps that you can follow to solve it in 3 minutes:

First you need to install the “matplotlib” on PyCharm following the instructions here: https://stackoverflow.com/questions/21883768/pycharm-and-external-libraries

Then, to import matplotlib, you need the following lines:

import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt

Done! You are ready to use matplotlib on PyCharm interpreter, by using:

plt.plot(...)
plt.show()
Advertisement

Author: mathtuition88

Math and Education Blog

One thought on “import matplotlib on PyCharm: Quick 3 min solution”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: