Python got the following error at the command prompt of Windows7
LookupError: unknown encoding: cp65001
This is because the character code of the command prompt, cp65001, is unknown to python.
If it was your own program
import sys
import codecs
def cp65001(name):
if name.lower() == 'cp65001':
return codecs.lookup('utf-8')
codecs.register(cp65001)
You can write it like this and define cp65001 as utf-8.
The above method cannot be used with python tools such as pip. For example, if this comes out with pip install etc.
If you say so, set the environment variable
PYTHONIOENCODING=utf-8
You can give it as.
Recommended Posts