0
votes

Then trying to import matplotlib in Python 3.7 using:

from matplotlib import pyplot as plt

The following error is given.

Traceback (most recent call last): 
File "C:/Users/EDRM/PycharmProjects/pythonProject/main.py", line 2, in <module>
from matplotlib import pyplot as plt
File "C:\Users\EDRM\PycharmProjects\pythonProject\venv\lib\site-packages\matplotlib\__init__.py"
line 174, in <module> _check_versions()
File "C:\Users\EDRM\PycharmProjects\pythonProject\venv\lib\site-packages\matplotlib\__init__.py", line 159, in _check_versions
from . import ft2font
ImportError: DLL load failed: The specified module could not be found.
Process finished with exit code 1

I have installed matlabplot via terminal, same error occurred, uninstalled it via terminal. Installed via settings, same issue. Uninstalled via terminal, and reinstalled, but nothing helped.

in: C:\Users\EDRM\PycharmProjects\pythonProject\venv\lib\site-packages\matplotlib I can find the pyplot file. What is the issue and how do I resolve it?

Cheers

2

2 Answers

0
votes

I'm not sure why this was the case however by downgrading matplotlib to version 3.0.3 the above problem was resolved. Type the following in terminal:

pip uninstall matplotlib

pip install matplotlib==3.0.3
-2
votes

just write import pandas and most probably it will solve your problem

enter image description here