У меня установлена Python 3.6.5 в моем MacBook Pro с anaconda 5.2.0. Если я пытаюсь установить любую библиотеку через pip install
, я получаю следующее сообщение об ошибке. Не могли бы вы дать мне знать, почему? Далее я привожу пример pip install spacy
.
$ pip install spacy
Collecting spacy
Exception:
Traceback (most recent call last):
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main
status = self.run(options, args)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 318, in run
resolver.resolve(requirement_set)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/resolve.py", line 102, in resolve
self._resolve_one(requirement_set, req)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/resolve.py", line 256, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/resolve.py", line 209, in _get_abstract_dist_for
self.require_hashes
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/operations/prepare.py", line 218, in prepare_linked_requirement
req.populate_link(finder, upgrade_allowed, require_hashes)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 164, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/index.py", line 572, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/index.py", line 534, in find_all_candidates
self._package_versions(page.iter_links(), search)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/index.py", line 701, in _package_versions
for link in self._sort_links(links):
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/index.py", line 690, in _sort_links
for link in links:
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_internal/index.py", line 880, in iter_links
namespaceHTMLElements=False,
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 47, in parse
return p.parse(doc, **kwargs)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 289, in parse
self._parse(stream, False, None, *args, **kwargs)
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 134, in _parse
self.mainLoop()
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 205, in mainLoop
for token in self.normalizedTokens():
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/html5parser.py", line 264, in normalizedTokens
for token in self.tokenizer:
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/_tokenizer.py", line 59, in __iter__
while self.state():
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/_tokenizer.py", line 243, in dataState
data = self.stream.char()
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/_inputstream.py", line 246, in char
if not self.readChunk():
File "/Users/sh0/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/_inputstream.py", line 265, in readChunk
data = self.dataStream.read(chunkSize)
File "/Users/sh0/anaconda3/lib/python3.6/codecs.py", line 499, in read
data = self.bytebuffer + bytes(newdata,encoding='utf8')
TypeError: encoding without a string argument