phaplt / winpython

Automatically exported from code.google.com/p/winpython
0 stars 0 forks source link

matplotlib import #90

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1.install winpython under C:\Python27\WinPython-64bit-2.7.5.3
2.import matplotlib (or just open spyder)
3.

What is the expected output? What do you see instead?

error in importing matplotlib, as following:
import matplotlib.font_manager as font_manager
  File "C:\Python27\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\matplotlib\font_manager.py", line 1356, in <module>
    _rebuild()
  File "C:\Python27\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\matplotlib\font_manager.py", line 1341, in _rebuild
    fontManager = FontManager()
  File "C:\Python27\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\matplotlib\font_manager.py", line 1004, in __init__
    self.ttflist = createFontList(self.ttffiles)
  File "C:\Python27\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\matplotlib\font_manager.py", line 584, in createFontList
    prop = ttfFontProperty(font)
  File "C:\Python27\WinPython-64bit-2.7.5.3\python-2.7.5.amd64\lib\site-packages\matplotlib\font_manager.py", line 398, in ttfFontProperty
    sfnt4 = sfnt4.decode('ascii').lower()
UnicodeDecodeError: 'ascii' codec can't decode byte 0x82 in position 0: ordinal 
not in range(128)

What version of the product are you using? On what operating system?

WinPython 64bit 2.7.5.3, OS W7pro

Please provide any additional information below.

Problem solved following instructions at 
http://stackoverflow.com/questions/18689854/enthought-matplotlib-problems-with-p
lot-function
reproduced here:
[Open the following in a text editor:
\Users\dafonseca\AppData\Local\Enthought\Canopy\User\lib\site- 
packages\matplotlib\font_manager.py
Search for sfnt4 = sfnt4.decode('ascii').lower()
And replace with sfnt4 = sfnt4.decode('ascii', 'ignore').lower()
This is a known issue in matplotlib 1.3.0 that relates to having a non-ASCII 
character in one of the font names. Note that this bug won't exist in the next 
release of matplotlib.]

Original issue reported on code.google.com by frances.alain@gmail.com on 29 Oct 2013 at 9:38