UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-14: ordinal not in range(128

这里写图片描述


C:\Windows\system32>pip install redis
Collecting redis
C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading redis-2.10.5-py2.py3-none-any.whl (60kB)
Exception:
Traceback (most recent call last):
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\download.py", line 821, in unpack_url
    hashes=hashes
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\download.py", line 659, in unpack_http_url
    hashes)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\download.py", line 882, in _download_http_url
    _download_url(resp, link, content_file, hashes)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\download.py", line 603, in _download_url
    hashes.check_against_chunks(downloaded_chunks)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\utils\hashes.py", line 46, in check_against_chunks
    for chunk in chunks:
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\download.py", line 571, in written_chunks
    for chunk in chunks:
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\utils\ui.py", line 141, in iter
    self.next(n)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\progress\__init__.py", line 73, in next
    self.update()
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\progress\bar.py", line 79, in update
    self.writeln(line)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\progress\helpers.py", line 68, in writeln
    print(line, end='', file=self.file)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\colorama\ansitowin32.py", line 141, in write
    self.write_and_convert(text)
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\colorama\ansitowin32.py", line 169, in write_and_convert
    self.write_plain_text(text, cursor, len(text))
  File "C:\Program Files\Python2.7\lib\site-packages\pip-9.0.1-py2.7.egg\pip\_vendor\colorama\ansitowin32.py", line 174, in write_plain_text
    self.wrapped.write(text[start:end])
UnicodeEncodeError: 'ascii' codec can't encode characters in position 9-14: ordinal not in range(128)

今天使用 pip install 的时候报错,

按道理讲的话,使用管理员身份命令行运行 pip 命令不应该报错的啊

于是乎突然想起 pycharm 里有一个程序好像好在运行

遂关掉程序

ok

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值