首先,我查看了所有UnicodeDecodeError问题和答案,但它们主要是针对编写自己的程序的人,我只是想安装一些东西。
使用pip为https://github.com/antiboredom/audiogrep安装一些要求并继续收到此错误(编辑为包含完整回溯):
PS C:\Users\Oisín\audiogrep> pip install -r requirements.txt
Collecting pydub==0.9.5 (from -r requirements.txt (line 1))
Exception:
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\pip\basecommand.py", line 232, in main
status = self.run(options, args)
File "C:\Python27\lib\site-packages\pip\commands\install.py", line 339, in run
requirement_set.prepare_files(finder)
File "C:\Python27\lib\site-packages\pip\req\req_set.py", line 333, in prepare_files
upgrade=self.upgrade,
File "C:\Python27\lib\site-packages\pip\index.py", line 305, in find_requirement
page = self._get_page(main_index_url, req)
File "C:\Python27\lib\site-packages\pip\index.py", line 783, in _get_page
return HTMLPage.get_page(link, req, session=self.session)
File "C:\Python27\lib\site-packages\pip\index.py", line 872, in get_page
"Cache-Control": "max-age=600",
File "C:\Python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 473, in get
return self.request('GET', url, **kwargs)
File "C:\Python27\lib\site-packages\pip\download.py", line 365, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "C:\Python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 461, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\pip\_vendor\requests\sessions.py", line 610, in send
r.content
File "C:\Python27\lib\site-packages\pip\_vendor\requests\models.py", line 730, in content
self._content = bytes().join(self.iter_content(CONTENT_CHUNK_SIZE)) or bytes()
File "C:\Python27\lib\site-packages\pip\_vendor\requests\models.py", line 655, in generate
for chunk in self.raw.stream(chunk_size, decode_content=True):
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 256
data = self.read(amt=amt, decode_content=decode_content)
File "C:\Python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\response.py", line 186
data = self._fp.read(amt)
File "C:\Python27\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 54, in read
self.__callback(self.__buf.getvalue())
File "C:\Python27\lib\site-packages\pip\_vendor\cachecontrol\controller.py", line 217, in cache_
self.serializer.dumps(request, response, body=body),
File "C:\Python27\lib\site-packages\pip\download.py", line 268, in set
return super(SafeFileCache, self).set(*args, **kwargs)
File "C:\Python27\lib\site-packages\pip\_vendor\cachecontrol\caches\file_cache.py", line 83, in
with FileLock(name) as lock:
File "C:\Python27\lib\site-packages\pip\_vendor\lockfile\mkdirlockfile.py", line 18, in __init__
LockBase.__init__(self, path, threaded, timeout)
File "C:\Python27\lib\site-packages\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 0xed in position 3: ordinal not in range(128)
不确定pip是否适用于我,因为我还没有安装任何东西。在路径操作之后错误出现的事实可能是一个很好的提示。我的名字中有一个'í',所以它也在路径名中,可能会导致这个问题。我怎样才能解决这个问题? (在系统上更改我的名字似乎很笨重)
Windows 7,Python 2.7并在PowerShell中执行此操作