python 安装第三方库的时候出现的问题,求助

2016-10-23 23:57:32 +08:00
 chenguoyu
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 9: ordinal not in range(128)



Try to run this command from the system terminal. Make sure that you use the correct version of 'pip' installed for your Python interpreter located at 'C:\Python27\python.exe'.



Collecting pip==8.1.2

You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
The repository located at pypi.douban.com is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with '--trusted-host pypi.douban.com'.
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\basecommand.py", line 223, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\commands\install.py", line 282, in run
requirement_set.prepare_files(finder)
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\req\req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\req\req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\req\req_set.py", line 491, in _prepare_file
session=self.session)
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\download.py", line 825, in unpack_url
session,
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "C:\Python27\lib\site-packages\pip-7.1.0-py2.7.egg\pip\download.py", line 884, in _download_http_url
file_path = os.path.join(temp_dir, filename)
File "C:\Python27\lib\ntpath.py", line 108, in join
path += "\\" + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xb3 in position 9: ordinal not in range(128)
26944 次点击
所在节点    Python
5 条回复
guyskk
2016-10-24 00:12:51 +08:00
你的 Windows 用户名是不是中文?
Trim21
2016-10-24 00:31:09 +08:00
可能需要先 chcp 65001 。。。
coreki
2016-10-24 00:59:54 +08:00
检查输出目标编码
chenguoyu
2016-10-24 09:37:56 +08:00
@guyskk 需要改成英文是吗
guyskk
2016-10-24 11:42:24 +08:00
@chenguoyu 是的

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/314881

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX