Python 2.7 : LookupError: unknown encoding: cp65001 [duplicate]

The error means that Unicode characters that your script are trying to print can’t be represented using the current console character encoding.

Also try to run set PYTHONIOENCODING=UTF-8 after execute pip –version without reloading terminal if everything going well add PYTHONIOENCODING as env variable with value UTF-8. See How to set the path and environment variables in Windows article to get info how to add Windows variable.

NOTE: For PowerShell use $env:PYTHONIOENCODING = "UTF-8"

Also you can try to install win-unicode-console with pip:

pip install win-unicode-console

Then reload your terminal and try to execute pip --version

However you can follow suggestions from Windows cmd encoding change causes Python crash answer because you have same problem.

Leave a Comment