pip issues UnicodeDecodeError on Windows 10 for Russian language
See original GitHub issue- Pip version: 9.0.1
- Python version: 3.6.0
- Operating system: Microsoft Windows 10 Home Edition [Version 10.0.10586] for Russian language
Description:
pip issues UnicodeDecodeError on byte 0x8d in Windows 10 for Russian language. It is not a problem for Windows 7 Ultimate SP1 for English language. Probably has something to do with default CMD encoding, please fix it.
What I’ve run:
C:\WINDOWS\system32>pip install pyyaml
Collecting pyyaml
Using cached PyYAML-3.12.tar.gz
Building wheels for collected packages: pyyaml
Running setup.py bdist_wheel for pyyaml ... error
Failed building wheel for pyyaml
Running setup.py clean for pyyaml
Failed to build pyyaml
Installing collected packages: pyyaml
Running setup.py install for pyyaml ... error
Exception:
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\site-packages\pip\compat\__init__.py", line 73, in console_to_str
return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 68: invalid start byte
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\program files (x86)\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "c:\program files (x86)\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install
**kwargs
File "c:\program files (x86)\python36-32\lib\site-packages\pip\req\req_install.py", line 878, in install
spinner=spinner,
File "c:\program files (x86)\python36-32\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess
line = console_to_str(proc.stdout.readline())
File "c:\program files (x86)\python36-32\lib\site-packages\pip\compat\__init__.py", line 75, in console_to_str
return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8d in position 68: invalid start byte
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (7 by maintainers)
Top Results From Across the Web
yet another encoding issue. Windows 8.1, both latest pythons ...
I run python get-pip.py from command prompt - this installed the pip correctly. I had it from here. Afterwards I run pip install...
Read more >codecs — Codec registry and base classes — Python 3.11.1 ...
Looks up the codec info in the Python codec registry and returns a CodecInfo ... On encoding, use hexadecimal form of Unicode code...
Read more >UnicodeDecodeError in mimetypes.py (#2377) · Issues · PyPy / pypy ...
Created originally on Bitbucket by Tiberiumk (Tiberium) Using last version of PyPy on Windows (5.3.1), issuing a "pypy -m ensurepip" command...
Read more >Unicode and UTF-8 Output Text Buffer - Windows Command ...
In this post, we'll discuss the improvements we've been making to the Windows Console's internal text buffer, enabling it to better store ...
Read more >Russian charecters are not displayed correctly in sqlci with ...
Hello! I am trying to use sqlcl, but get problems with Russian symbols. ... So on windows 10 computer I set UTF8 codepage...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Add a solution here: run a new cmd.exe console
chcp
it will show the system default code, for example 936. openLib/site-package/pip/compat/__init__.py
around 75 line, changereturn s.decode('utf_8')
toreturn s.decode('cp936')
It’s just a workaround. I think pip might need solve this issue asap, it’s not easy to find solution.
This may have a general solution using cdll. Not sure if this is the best solution on windows but I still made a PR for this issue.
I thought pip is suposed to be easy for users, is it possible to hide this problems from us ?😃