5

尝试通过 pip 安装任何 python 包时,我在 parse() 中遇到意外的 arg:keyword encoding。

我遇到了这个问题,因为我为 python 3.6 安装了 tensorflow,这可能导致 html5lib 和 setuptools 出现一些问题。已使用 tar.gz 文件(管理员安装)重新安装了 html5lib1.0b10,但问题仍然存在。请帮忙!!

pip install spacy
Collecting spacy
Exception:
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
    wb.build(autobuilding=True)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
    self.requirement_set.prepare_files(self.finder)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_set.py", line 554, in _prepare_file
    require_hashes
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\req\req_install.py", line 278, in populate_link
    self.link = finder.find_requirement(self, upgrade)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirement
    all_candidates = self.find_all_candidates(req.name)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_candidates
    for page in self._get_pages(url_locations, project_name):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
    page = self._get_page(location)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
    return HTMLPage.get_page(link, session=self.session)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
    inst = cls(resp.content, resp.url, resp.headers)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pip\index.py", line 731, in __init__
    namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'
4

2 回答 2

10

问题确实出在 html5lib 和 setuptools 上,我使用重新安装了 html5lib

conda install -c anaconda html5lib

尽管软件包版本相同,但它说“以下软件包将被更高优先级的频道取代”,并安装了 conda、conda-env、html5lib。我不确定更高优先级的频道部分。但这回答了我的问题!

于 2017-10-02T15:57:00.710 回答
5

安装后出现问题tensorflow 1.3.0

重新安装html5lib

conda uninstall html5lib --force
conda install html5lib

暂时解决问题直到下一个pip install --upgrade tensorflow。也有同样的问题pip install --upgrade tensorflow-gpu

于 2017-10-06T13:50:31.083 回答