WIN10 on Python3 when installing via PIP install twisted appears unicodedecodeerror

Source: Internet
Author: User

Pip Install Twisted

Error:

C:\windows\system32>pip install twistedcollecting Twisted Using cached twisted-17.9.0.tar.Bz2requirement already Satisfied:zope. interface>=4.0.2 in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from Twisted)requirement already satisfied:constantly>=15.1 in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from Twisted)requirement already satisfied:incremental>=16.10.1 in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from Twisted)requirement already Satisfied:automat>=0.3.0 in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from Twisted)requirement already satisfied:hyperlink>=17.1.1 in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from Twisted)requirement already satisfied:setuptools in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from zope.interface>=4.0.2->twisted)requirement already satisfied:attrs in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from automat>=0.3.0->twisted)requirement already satisfied:six in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from automat>=0.3.0->twisted)requirement already Satisfied:idna>=2.5 in C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages (from hyperlink>=17.1.1-> Twisted)Installing collected packages:twisted Running setup. PY Install forTwisted ...Errorexception:traceback(Most recentPagerLast: File"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\compat\__init__.py", line 73,In console_to_strreturnS.decode (sys.__stdout__.encoding)unicodedecodeerror: ' utf-8 ' codec can ' t decode byte 0xd5 in position 2: Invalid continuation byteduring handling of the above exception,another exception Occurred:traceback(Most recentPagerLast: File"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\basecommand.py", line 215,In main status= self.Run(Options, args)File"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\commands\install.py", line 342, inRunprefix=options.prefix_path,File"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_set.py", line 784,In install **kwargs File"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\req\req_install.py", line 878,In install spinner=spinner,File"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\utils\__init__.py", line 676,In call_subprocess line= Console_to_str (Proc.stdout.readline ())File"C:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\compat\__init__.py", line 75,In console_to_strreturnS.decode (' Utf-8 ')unicodedecodeerror: ' utf-8 ' codec can ' t decode byte 0xd5 in position 2:invalid continuation byte

Solution:

Open "c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\compat\__init__.py", navigate to line 75, Change return S.decode (' Utf-8 ') to return S.decode (' cp936 ')

Reason:
Coding problem, although Py3 unified with Utf-8. But the end of the win display with or GBK encoding.

WIN10 on Python3 when installing via PIP install twisted appears unicodedecodeerror

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.