python compiler error

UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 3:ordi

 

Because while the python2 and python3 installed, so the emergence of this mistake

 

Solution:

Python2 installation into the folder (such as C: \ Python27) in Lib \ mimetypes.py add code, according to the following may be added directly in the import FIG.

 

 

 

if sys.getdefaultencoding() != 'gbk':
    reload(sys)
    sys.setdefaultencoding('gbk')

 

Then execute the following statement

python -m pip install --upgrade pip

 

 

Reference: solve "UnicodeDecodeError: 'ascii' codec can not decode byte 0xc0 in position 7: ordi"

Guess you like

Origin www.cnblogs.com/code1992/p/11464812.html