Matplotlib does not work after successful installation on Mountain Lion

I installed all the dependencies listed on the matplotlib website . However, it still does not work. I have listed the python stack trace and installed the python packages below. So how can I solve this problem?

Python stack trace:

>>> import pylab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Library/Python/2.7/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/Library/Python/2.7/site-packages/matplotlib/pylab.py", line 229, in <module> import matplotlib.finance File "/Library/Python/2.7/site-packages/matplotlib/finance.py", line 37, in <module> from matplotlib.collections import LineCollection, PolyCollection File "/Library/Python/2.7/site-packages/matplotlib/collections.py", line 26, in <module> import matplotlib.backend_bases as backend_bases File "/Library/Python/2.7/site-packages/matplotlib/backend_bases.py", line 54, in <module> import matplotlib.textpath as textpath File "/Library/Python/2.7/site-packages/matplotlib/textpath.py", line 18, in <module> import matplotlib.font_manager as font_manager File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 1354, in <module> _rebuild() File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 1339, in _rebuild fontManager = FontManager() File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 987, in __init__ self.ttffiles = findSystemFonts(paths) + findSystemFonts() File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 316, in findSystemFonts for f in get_fontconfig_fonts(fontext): File "/Library/Python/2.7/site-packages/matplotlib/font_manager.py", line 280, in get_fontconfig_fonts for line in output.split('\n'): UnicodeDecodeError: 'ascii' codec can't decode byte 0xe5 in position 16560: ordinal not in range(128) 

Installed python packages:

 >$ pip freeze PyRSS2Gen==1.0.0 Twisted==12.0.0 altgraph==0.9 bdist-mpkg==0.4.4 bonjour-py==0.3 macholib==1.4.2 matplotlib==1.4.x modulegraph==0.9.1 nose==1.3.0 numpy==1.7.1 py2app==0.6.3 pyOpenSSL==0.13 pyobjc-core==2.3.2a0 pyobjc-framework-AddressBook==2.3.2a0 pyobjc-framework-AppleScriptKit==2.3.2a0 pyobjc-framework-AppleScriptObjC==2.3.2a0 pyobjc-framework-Automator==2.3.2a0 pyobjc-framework-CFNetwork==2.3.2a0 pyobjc-framework-CalendarStore==2.3.2a0 pyobjc-framework-Cocoa==2.3.2a0 pyobjc-framework-Collaboration==2.3.2a0 pyobjc-framework-CoreData==2.3.2a0 pyobjc-framework-CoreLocation==2.3.2a0 pyobjc-framework-CoreText==2.3.2a0 pyobjc-framework-DictionaryServices==2.3.2a0 pyobjc-framework-ExceptionHandling==2.3.2a0 pyobjc-framework-FSEvents==2.3.2a0 pyobjc-framework-InputMethodKit==2.3.2a0 pyobjc-framework-InstallerPlugins==2.3.2a0 pyobjc-framework-InstantMessage==2.3.2a0 pyobjc-framework-InterfaceBuilderKit==2.3.2a0 pyobjc-framework-LatentSemanticMapping==2.3.2a0 pyobjc-framework-LaunchServices==2.3.2a0 pyobjc-framework-Message==2.3.2a0 pyobjc-framework-OpenDirectory==2.3.2a0 pyobjc-framework-PreferencePanes==2.3.2a0 pyobjc-framework-PubSub==2.3.2a0 pyobjc-framework-QTKit==2.3.2a0 pyobjc-framework-Quartz==2.3.2a0 pyobjc-framework-ScreenSaver==2.3.2a0 pyobjc-framework-ScriptingBridge==2.3.2a0 pyobjc-framework-SearchKit==2.3.2a0 pyobjc-framework-ServerNotification==2.3.2a0 pyobjc-framework-ServiceManagement==2.3.2a0 pyobjc-framework-SyncServices==2.3.2a0 pyobjc-framework-SystemConfiguration==2.3.2a0 pyobjc-framework-WebKit==2.3.2a0 pyobjc-framework-XgridFoundation==2.3.2a0 pyparsing==2.0.1 python-dateutil==2.1 scipy==0.12.0 six==1.4.1 stevedore==0.11 tornado==3.1.1 virtualenv==1.10.1 virtualenv-clone==0.2.4 virtualenvwrapper==4.1.1 wsgiref==0.1.2 xattr==0.6.2 zope.interface==3.5.1 
+1
source share
1 answer

This is a bug in matplotlib 1.4.x, where fontmanager.py trying to import a font whose name contains a non ascii character.

Your question is similar to this one , but the specified patch will not help you, because you have matplotlib 1.4.x installed, not 1.3.0.

As mentioned above, you can take a look at the list of fonts and try to delete fonts with characters without ascii. Pay particular attention to Æ .

Or you can try upgrading to the matplotlib development version, where it looks fixed :

 pip install git+https://github.com/matplotlib/matplotlib.git#egg=matplotlib-dev 
+5
source

Source: https://habr.com/ru/post/982137/


All Articles