Solution for Python Extention matplotlib.pyplot loading Error

When I execute the following python instruction in python shell
 
>>>import matplotlib.pyplot as plt

error occured and the error message show as follows,
"UnicodeDecodeError: 'ascii' codec can't decode byte 0xea in position 0: ordinal not in range(128)"

Solution:
Before execution of import instruction, add this set of instructions:
 
>>> import sys
>>> reload(sys)
>>> sys.setdefaultencoding('utf-8')python

相關文章
相關標籤/搜索