Issues with my installation of Matplotlib

I am on a windows 10 and i am trying to import Matplotlib.pyplot in Anaconda, however i get this error:


ImportError Traceback (most recent call last)
in
1 import pandas as pd
2 import numpy as np
----> 3 import matplotlib.pyplot as plt
4 get_ipython().run_line_magic(‘matplotlib’, ‘inline’)

~\AppData\Roaming\Python\Python37\site-packages\matplotlib_init_.py in
203
204
→ 205 _check_versions()
206
207

~\AppData\Roaming\Python\Python37\site-packages\matplotlib_init_.py in _check_versions()
188 # Quickfix to ensure Microsoft Visual C++ redistributable
189 # DLLs are loaded before importing kiwisolver
→ 190 from . import ft2font
191
192 for modname, minver in [

ImportError: cannot import name ‘ft2font’ from ‘matplotlib’ (C:\Users\kpy\AppData\Roaming\Python\Python37\site-packages\matplotlib_init_.py)

It was working fine until very recently when i tried again.

@kurtispykes In https://github.com/matplotlib/jupyter-matplotlib/issues/155 you said you got this fixed. What was the underlying issue?

As you had cleverly noticed, I had installed python from python.org and Anaconda was using that instead. I believe it may have something to do with me selecting add PATH during installation, I will reinstall python without selecting that option and confirm. Thanks once again!

Interesting, I had a pure install from Anaconda distribution from the beginning and used conda to update jupyter, but yet, it dropped an invalid file that caused this error.

Seems like conda must have a bug. I think I finally have my issue resolved.

Thanks

What did you do to resolve the issue?

@tacaswell sorry for my lack of clarity… I removed the python directory and everything worked fine in my Anaconda environment

And @dwervin, what did you do to sort out your problem?

my version of python is python 3.8.2
as for my version of gcc i don’t know what that means

I am trying to install Matplotlib from my Pycharm as shown below using the + sign here

i got this error


pls help out i have a deadline to meet thanks

@kennetheno Can you please copy-paste the full error? Trying to debug from screenshots is extremely difficult (they can’t be searched and important information is cut off.

1 Like

ok @tacaswell
thanks

the restrain am having is that the length of the error code is more than the maximum body character of 32000 characters

while the error code is 62923 characters
please what other means should i use to send the error code
thanks

I suggest a link to a gist on github or filtering on the error message a bit before you post it.

@kennetheno @tacaswell has any progress been made on the FreeType error? I am also running into it

@Dylan_Dilla Can you provide the traceback you are getting?

Can you please also tell us:

  • Operating system and version
  • Python version
  • How you install Python
  • How you install Matplotlib
sudo apt-get install libfreetype6-dev
sudo apt-get install pkg-config
sudo apt-get install libpng12-dev
sudo apt-get install pkg-config

Ref: https://hackaday.io/project/53896-weedinator-2019/log/153140-jupyter-notebook-3-days-to-get-a-photo-of-a-cat