安装windows 8的pip时出错(希伯来语)

2024-10-06 13:24:09 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我正在尝试在我的电脑上安装pip-希伯来语windows 8。在

我安装了python2.7。我把python添加到我的路径中。在

我在python文件中运行了一些随机打印及其工作。所以python没问题。在

当我尝试安装get时-点对点我得到这个错误:

C:\Users\yogi>python get-pip.py
Exception:
Traceback (most recent call last):
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\basecommand.py",
line 232, in main
    status = self.run(options, args)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\commands\install.
py", line 339, in run
    requirement_set.prepare_files(finder)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\req\req_set.py",
line 235, in prepare_files
    req_to_install, self.upgrade)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\index.py", line 3
05, in find_requirement
    page = self._get_page(main_index_url, req)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\index.py", line 7
83, in _get_page
    return HTMLPage.get_page(link, req, session=self.session)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\index.py", line 8
72, in get_page
    "Cache-Control": "max-age=600",
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
sessions.py", line 473, in get
    return self.request('GET', url, **kwargs)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\download.py", lin
e 365, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
sessions.py", line 461, in request
    resp = self.send(prep, **send_kwargs)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
sessions.py", line 610, in send
    r.content
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
models.py", line 728, in content
    self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes
()
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
models.py", line 653, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
packages\urllib3\response.py", line 256, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\requests\
packages\urllib3\response.py", line 186, in read
    data = self._fp.read(amt)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\cachecont
rol\filewrapper.py", line 54, in read
    self.__callback(self.__buf.getvalue())
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\cachecont
rol\controller.py", line 213, in cache_response
    self.serializer.dumps(request, response, body=body),
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\download.py", lin
e 268, in set
    return super(SafeFileCache, self).set(*args, **kwargs)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\cachecont
rol\caches\file_cache.py", line 83, in set
    with FileLock(name) as lock:
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\lockfile\
mkdirlockfile.py", line 18, in __init__
    LockBase.__init__(self, path, threaded, timeout)
  File "c:\users\yogi\appdata\local\temp\tmppowtnc\pip.zip\pip\_vendor\lockfile\
__init__.py", line 189, in __init__
    hash(self.path)))
  File "C:\Python27\lib\ntpath.py", line 84, in join
    result_path = result_path + p_path
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 0: ordinal
not in range(128)

任何帮助都将不胜感激


Tags: pipinpyselfgetlocallinezip
2条回答

UnicodeDecode错误可能是因为使用了错误版本的get-点对点. 默认情况下,Python3中的所有字符串都是unicode,但在Python2中则不是这样。在

如果您试图使用getpip of Python3和Python2,这可能是错误。请尝试正在检查/获取正确的版本!:)

我想你可能想试试这些,因为你是用希伯来语安装的。在

1.)打开路径"C:\Python27\Lib\",搜索python文件“mimetypes.py”。在

2.)打开并编辑该文件。搜索行“default_encoding = sys.getdefaultencoding()

3.)并将这些行添加到中搜索的行之前(步骤2):

if sys.getdefaultencoding() != 'gbk':
  reload(sys)
  sys.setdefaultencoding('gbk')

相关问题 更多 >