Win10上Python3通过pip install Twisted安装时出现UnicodeDecodeError

pip install Twisted

报错:

C:\Windows\system32>pip install Twisted
Collecting Twisted
  Using cached Twisted-17.9.0.tar.bz2
Requirement 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 for Twisted ... error
Exception:
Traceback (most recent call last):
  File "c:\users\xxx\appdata\local\programs\python\python36\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 0xd5 in position 2: invalid continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  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, in run
    prefix=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_str
    return s.decode(‘utf-8‘)
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xd5 in position 2: invalid continuation byte

解决方案:

打开"c:\users\xxx\appdata\local\programs\python\python36\lib\site-packages\pip\compat\__init__.py",定位至75行,修改return s.decode(‘utf-8‘)为return s.decode(‘cp936‘)

原因: 
编码问题,虽然py3统一用utf-8了。但win下的终端显示用的还是gbk编码。

原文地址:https://www.cnblogs.com/cnfangbo/p/8511692.html

时间: 2024-11-06 11:05:23

Win10上Python3通过pip install Twisted安装时出现UnicodeDecodeError的相关文章

Win10上Python3通过pip安装时出现UnicodeDecodeError

http://blog.csdn.net/qq_33530388/article/details/68933201 解决方法: 打开 c:\program files\python36\lib\site-packages\pip\compat\__init__.py 约75行 return s.decode('utf_8') 改为return s.decode('cp936') 原因: 编码问题,虽然py3统一用utf-8了.但win下的终端显示用的还是gbk编码. 原文地址:https://w

词云:解决pip install wordcloud安装过程中报错“error: command 'x86_64-linux-gnu-gcc' failed with exit status 1”问题

外部环境:ubuntu16.04, 64bits, 全局环境python2.7 在虚拟环境(python3.5)中执行 pip install wordcloud 时安装失败,报错: error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for wordcloud Running setup.py

pip install mysqlclient 安装失败

使用pip install mysqlclient安装 在虚拟工作环境中使用pip install mysqlclient安转,出现以下问题: 解决办法: 点击进入网址 根据自己的版本下载对应的资源 再次报错: 因为下载的版本不对 安装成功! 原文地址:https://www.cnblogs.com/fengqimeng/p/12178791.html

完美解决pip install scrapy,安装Scrapy错误:Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

1,在Python3.6 安装Scrapy 出现以下报错 2,错误分析 红色报的错误指向的是Twisted 1,Twisted 没安装上 2,Twisted 没安装成功 3,Twisted 版本与Python的版本不适配 3,解决办法 下载与Python版本适配的Twisted离线安装 python各种封装包地址, 解决python多包问题  https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml 4,离线安装 下载好离线安装包 ,把文件拖拽到上面写好

windows pip install twisted troubleshooting

twisted error 在windows中使用pip安装twisted的时候出现error如下: pystate.h 文件exc_type exc_value exc_traceback不是 _ts的成员.打开pystate.h文件,找到_ts的结构体 typedef struct _ts 添加如下代码:_PyErr_StackItem exc_type;_PyErr_StackItem exc_value;_PyErr_StackItem *exc_traceback; ```保存即可!`

Windows Install Twisted 安装Twisted

1.下载twisted exe https://twistedmatrix.com/Releases/Twisted/15.4/ (注意最新版16.x没有适用于windows的exe,只能用旧版) 2.pypiwin32 https://pypi.python.org/pypi/pypiwin32 下载那个exe

在win10上的xampp集成环境中安装mongo扩展

按照网上搜索的下载对应文件后,在phpinfo里面还是找不到mongo的扩展信息,后面也是请教同事帮忙解决: http://www.thegeekstuff.com/2015/10/php-mongodb-for-xampp/ 不能简单的根据电脑是64位的便下载64位的mongo扩展文件,而是要根据参数Architecture来,这里是x86,应该下载32位的. 下载32位的,重启apache,phpinfo出现mongo扩展,问题解决.以下这篇也值得一看:http://www.cnblogs.

Linux安装python3、pip以及pycharm

Python3安装 Linux下默认系统自带python2.7的版本,这个版本被系统很多程序所依赖,所以不建议删除.如果使用最新的Python3那么我们知道编译安装源码包和系统默认包之间是没有任何影响的,所以可以安装python3和python2共存.下面是在CentOs7系统上进行演示: 一.首先到Python官网(www.python.org)下载Linux版本的Python3压缩包 二.下载完成后,解压释放文件.在此步骤前可以先安装支持环境依赖包: tar -xvzf Python-3.7

Win10上安装TensorFlow(官方文档翻译)

一.推荐两个网站 TensorFlow官方文档:https://www.tensorflow.org/install/install_windows TensorFlow中文社区:http://www.tensorfly.cn/tfdoc/get_started/os_setup.html 二.在 Windows 上安装 TensorFlow 目录: 确定要安装的 TensorFlow 使用 GPU 支持的TensorFlow 的要求 确定如何安装 TensorFlow 使用本机 pip 安装