我正在使用最新版本的 Anaconda3。我刚刚安装了它,我正在尝试下载一些软件包。我正在使用 Anaconda 提示。在尝试使用 pip 做任何事情(包括升级现有软件包)时,我得到以下回溯。
Exception:
Traceback (most recent call last):
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\req\req_set.py", line 487, in _prepare_file
req_to_install, finder)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\req\req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "C:\Users\csprock\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:\Users\csprock\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\Users\csprock\Anaconda3\lib\site-packages\pip\index.py", line 731, in __init__
namespaceHTMLElements=False,
TypeError: parse() got an unexpected keyword argument 'transport_encoding'
有任何想法吗? (这个问题只有在我安装了 tensorflow 之后才开始)谢谢。
conda install
有效吗?
我遇到了同样的问题,对我有用的是用 conda 更新 pip:
conda install pip
它将我的点从 9.0.1-py36hadba87b_3 更改为 9.0.1-py36h226ae91_4 并解决了问题。
下载 https://github.com/html5lib/html5lib-python/tree/master/html5lib 并覆盖 tensorflow 环境“envs\tensorflow\Lib\site-packages\html5lib”中 html5lib 文件夹中的所有文件,然后您应该能够运行任何“pip install”命令
conda install --force html5lib
为我解决了这个问题。
conda install -c anaconda html5lib
工作
我在最新版本的 Anaconda 3 上安装 keras 时遇到了同样的问题(在我使用 pip 安装了 tensorflow 1.3 之后)。我能够通过使用 conda conda install -c conda-forge keras
安装 keras 来解决这个问题
我在安装 SerpentAI 时遇到了这个确切的错误。我为修复它所做的只是在 conda 提示符下运行 activate serpent
,然后我再次运行该命令。不确定它是否适用于您的情况,但它们似乎足够接近它可能。
https://i.stack.imgur.com/5DePg.png
这对我来说非常有效。 (这需要我们社区的一位乐于助人的成员 8 小时来调试)
/usr/lib/python2.7/site-packages/pip/_internal/index.py
,注释同一行。现在完美运行
这对我有用:
python -m pip install --upgrade tensorflow
这是我的解决方法:
cd /usr/share/python-wheels/
目录内容:
-rwxrwxrwx 1 www-data www-data 493905 Jul 22 2015 html5lib-0.999-py2.py3-none-any.whl
-rw-r--r-- 1 root root 112620 Apr 3 2019 html5lib-0.999999999-py2.py3-none-any.whl
跑:
mv html5lib-0.999-py2.py3-none-any.whl html5lib-0.999-py2.py3-none-any.whl.bak
pip3 之后工作正常。正在加载旧的 0.999 版本。