Cause
conda update anaconda
Symptom
PS C:\Users\Jonas> conda install virtualenv
Traceback (most recent call last):
File "C:\Anaconda2\lib\logging\__init__.py", line 872, in emit
stream.write(ufs % msg)
LookupError: unknown encoding: cp65001
Logged from file exceptions.py, line 586
Traceback (most recent call last):
File "C:\Anaconda2\lib\logging\__init__.py", line 872, in emit
stream.write(ufs % msg)
LookupError: unknown encoding: cp65001
Logged from file exceptions.py, line 590
Traceback (most recent call last):
File "C:\Anaconda2\lib\logging\__init__.py", line 872, in emit
stream.write(ufs % msg)
LookupError: unknown encoding: cp65001
Logged from file exceptions.py, line 591
Traceback (most recent call last):
File "C:\Anaconda2\lib\logging\__init__.py", line 872, in emit
stream.write(ufs % msg)
LookupError: unknown encoding: cp65001
Logged from file exceptions.py, line 592
Traceback (most recent call last):
File "C:\Anaconda2\lib\logging\__init__.py", line 872, in emit
stream.write(ufs % msg)
LookupError: unknown encoding: cp65001
Logged from file exceptions.py, line 593
Error
LookupError: unknown encoding: cp65001
Check current output encoding
PS> [Console]::OutputEncoding
BodyName : utf-8
EncodingName : Unicode (UTF-8)
HeaderName : utf-8
WebName : utf-8
WindowsCodePage : 1200
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
IsSingleByte : False
EncoderFallback : System.Text.EncoderReplacementFallback
DecoderFallback : System.Text.DecoderReplacementFallback
IsReadOnly : False
CodePage : 65001
There's the unrecognized CodePage. For me, changing OutputEncoding fixed the issue:
Fix
PS> [Console]::OutputEncoding = [System.Text.Encoding]::Default
IsSingleByte : True
BodyName : iso-8859-1
EncodingName : Western European (Windows)
HeaderName : Windows-1252
WebName : Windows-1252
WindowsCodePage : 1252
IsBrowserDisplay : True
IsBrowserSave : True
IsMailNewsDisplay : True
IsMailNewsSave : True
EncoderFallback : System.Text.InternalEncoderBestFitFallback
DecoderFallback : System.Text.InternalDecoderBestFitFallback
IsReadOnly : False
CodePage : 1252
Fix 2
add PYTHONIOENCODING
as env variable with value UTF-8