Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
From matplotlib.font_manager, ImportError: cannot import name get_font #8168
Comments
|
Can you please include the full traceback? How did you install matplotlib? |
jtexnl
commented
Mar 12, 2017
|
I've had the same problem. Here's my traceback:
|
jtexnl
commented
Mar 12, 2017
|
FWIW, I tried re-jiggering my the base files that are showing problems, but it didn't work and I don't know the code well enough to make my own correction. From what I can gather, a lot of functions in font_manager are referencing a get_font function that's not defined in the script. |
|
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/font_manager.py#L1370 How did you install mpl? It looks like you have crossed versions of python, looking at these two lines:
it seems to be hitting system python and then hitting a version of python installed via brew. |
|
Closing as @tacaswell suggests a reasonable source for the problem (crossed python versions). Feel free to ask for a reopening. |
premier424 commentedFeb 27, 2017
I met an error when using pyplot in matplotlib. In
matplotlib/backends, there is from matplotlib.font_manager import findfont get_font. When I build and run the code, there shows the error:ImportError: cannot import name get_fontFrom current documentation of font_manager on matplorlib website, there is no get_font module introduced but it was used in the source code of matplotlib. There are few similar errors reporting online so I'm wondering is this a version problem of python or matlibplot but I'm not quite clear about this. Please give me some advices. The python version is 2.7.6 and matplotlib version is 2.0.0. Thanks.