I installed Anaconda and used Jupiter Notebooks successfully for a while.
I also have PyCharm on my laptop, but had some issues with certain missing libraries, so I installed Python directly and added something to PATH variable on my laptop.
Now, when I want to run matplotlib via jupiter notebooks, I get the following error:
“ImportError: cannot import name ‘ft2font’ from ‘matplotlib’”
Even when I change the PATH variable again, the problem persists.
I have uninstalled Anaconda. I have uninstalled PyCharm.
I have re-installed Anaconda, I have re-installed PyCharm.
(this took two hours :-))
Result: the same.
“ImportError: cannot import name ‘ft2font’ from ‘matplotlib’ (C:\Users\c_bre\AppData\Roaming\Python\Python37\site-packages\matplotlib_init_.py)”
I have renamed the folder “Python” to “PPPython” so it couldn’t use it anymore. Now Jupiter notebook works fine again. No more error message about mathplotlib.
For PyCharm I can’t get it fixed. For the Interpreter I have chosen “Conda”, but I don’t really understand how this works and I don’t find clear online tutorials about how to combine PyCharm with Anaconda.
I always get the message that the modules aren’t found (pandas, mathplotlib, numpy…).
I set up a python project, selected Conda Environment for the Project Interpreter then clicked the Existing environment button and clicked on the … button next to the Interpreter: field. On my Mac anaconda was installed in ~/opt/anaconda3 so I navigated to ~/opt/anaconda3/bin and selected python3 for the interpreter. Importing matplotlib in a simple script worked.