Python 3.6.4 / win10 使用pip安装keras时遇到依…
2018-06-18 00:20:53来源:未知 阅读 ()
PS C:\Users\myjac\Desktop\simple-chinese-ocr> pip install keras Collecting keras Downloading http://mirrors.aliyun.com/pypi/packages/68/89/58ee5f56a9c26957d97217db41780ebedca3154392cb903c3f8a08a52208/Keras-2.1.2-py2.py3-none-any.whl (304kB) 100% |████████████████████████████████| 307kB 4.7MB/s Collecting scipy>=0.14 (from keras) Downloading http://mirrors.aliyun.com/pypi/packages/09/e9/89a97bcdbdc7aaafea93b6638f9b167ab599b58b5f9832c5a589e8e5d005/scipy-1.0.0-cp36-none-win32.whl (26.0MB) 100% |████████████████████████████████| 26.0MB 11.4MB/s Requirement already satisfied: six>=1.9.0 in c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages (from keras) Requirement already satisfied: numpy>=1.9.1 in c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages (from keras) Collecting pyyaml (from keras) Downloading http://mirrors.aliyun.com/pypi/packages/4a/85/db5a2df477072b2902b0eb892feb37d88ac635d36245a72a6a69b23b383a/PyYAML-3.12.tar.gz (253kB) 100% |████████████████████████████████| 256kB 12.8MB/s Installing collected packages: scipy, pyyaml, keras Running setup.py install for pyyaml ... error Exception: Traceback (most recent call last): File "c:\users\myjac\appdata\local\programs\python\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 0xce in position 68: invalid continuation byte During handling of the above exception, another exception occurred: Traceback (most recent call last): File "c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args) File "c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages\pip\commands\install.py", line 342, in run prefix=options.prefix_path, File "c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_set.py", line 784, in install **kwargs File "c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages\pip\req\req_install.py", line 878, in install spinner=spinner, File "c:\users\myjac\appdata\local\programs\python\python36-32\lib\site-packages\pip\utils\__init__.py", line 676, in call_subprocess line = console_to_str(proc.stdout.readline()) File "c:\users\myjac\appdata\local\programs\python\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 0xce in position 68: invalid continuation byte
解决方案
看起来是标准输出流的编码不对的缘故。使用chcp命令,更改代码页为65001(UTF-8)再执行pip安装命令即可。
另外提供一些chcp命令的参考:
chcp 65001 就是换成UTF-8代码页 chcp 936 可以换回默认的GBK chcp 437 是美国英语
2018.01.05
标签:
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有
- python3基础之“术语表(2)” 2019-08-13
- python3 之 字符串编码小结(Unicode、utf-8、gbk、gb2312等 2019-08-13
- Python3安装impala 2019-08-13
- 小白如何入门 Python 爬虫? 2019-08-13
- python_字符串方法 2019-08-13
IDC资讯: 主机资讯 注册资讯 托管资讯 vps资讯 网站建设
网站运营: 建站经验 策划盈利 搜索优化 网站推广 免费资源
网络编程: Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术: Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧: 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷
网页制作: FrontPages Dreamweaver Javascript css photoshop fireworks Flash