close

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

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Python 2.7 : LookupError: unknown encoding: cp65001 in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Python 2.7 : LookupError: unknown encoding: cp65001 Error Occurs?

Today I get the following error Python 2.7 : LookupError: unknown encoding: cp65001 in python.

How To Solve Python 2.7 : LookupError: unknown encoding: cp65001 Error ?

  1. How To Solve Python 2.7 : LookupError: unknown encoding: cp65001 Error ?

    To Solve Python 2.7 : LookupError: unknown encoding: cp65001 Error However you can follow suggestions from Windows cmd encoding change causes Python crash answer because you have same problem.

  2. Python 2.7 : LookupError: unknown encoding: cp65001

    To Solve Python 2.7 : LookupError: unknown encoding: cp65001 Error However you can follow suggestions from Windows cmd encoding change causes Python crash answer because you have same problem.

Solution 1

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.

Solution 2

First of all you need to upgrade your pip. You can do this in Windows by:

python -m pip install -U pip

Then go manually to your script folder, enter command line from that folder (you can do this by clicking shift + right mouse button -> Open console window), and then you should use one of this commands.

pip -V
pip --version

This will result in

pip 7.1.2 from c:\python27\lib\site-packages (python 2.7)

If you still have trouble, you can try to remove your current Python PATH, and add a new one to Python 2.7.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read