I have just used conda to update my Anaconda installation and Matplotlib went from v1.4.0 to v1.4.2. However now all my Python jobs which use Matplotlib.pyplot are throwing exceptions.
Even the simple command:
import matplotlib.pyplot as plt
throws a TypeError
exception, saying:
cannot return std::string from Unicode object
The traceback tells me the exception is occurring in the font_manager.py file, here:
try:
font = ft2font.FT2Font(fpath)
except RuntimeError:
verbose.report("Could not open font file %s" % fpath)
continue
except UnicodeError:
verbose.report("Cannot handle unicode filenames")
continue
specifically at the line font = ft2font.FT2Font(fpath)
.
I tried going back to v1.4.0 of Matplotlib but it didn't fix the problem.
Then I edited font_manager.py to add a generic exception case:
except:
verbose.report("Some stupid error occurred")
continue
in the hope that it would temporarily get around the issue, which it did, but that error or something very similar to it occurred later. So then I removed the exception but the error is now still occurring at the later point in the code (so if I run import matplotlib.pyplot as plt
it works, but doing other commands can fail).
I use Matplotlib to generate/update hundreds of graphs throughout the day and now everything is broken.
Please help! Thanks!
It seems like uninstalling Anaconda and reinstalling a fresh version fixes the issue as mentioned by @pbreach, so closing this question out.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With