V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chenguoyu
V2EX  ›  Python

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

  •  
  •   chenguoyu · 2016-10-23 23:57:32 +08:00 · 26937 次点击
    这是一个创建于 2739 天前的主题,其中的信息可能已经有所发展或是发生改变。
    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)
    5 条回复    2016-10-24 11:42:24 +08:00
    guyskk
        1
    guyskk  
       2016-10-24 00:12:51 +08:00
    你的 Windows 用户名是不是中文?
    Trim21
        2
    Trim21  
       2016-10-24 00:31:09 +08:00 via Android
    可能需要先 chcp 65001 。。。
    coreki
        3
    coreki  
       2016-10-24 00:59:54 +08:00 via iPhone
    检查输出目标编码
    chenguoyu
        4
    chenguoyu  
    OP
       2016-10-24 09:37:56 +08:00
    @guyskk 需要改成英文是吗
    guyskk
        5
    guyskk  
       2016-10-24 11:42:24 +08:00 via Android
    @chenguoyu 是的
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4019 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 05:16 · PVG 13:16 · LAX 22:16 · JFK 01:16
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.