使用pip install时出错,我无法安装任何软件包

时间:2017-10-31 17:38:04

标签: python pip python-3.5 conda

我正在使用Python 3.5,我正在尝试安装一些软件包。我通常使用conda,当我这样做时一切都很好但是一些软件包不在anaconda存储库中,所以我然后使用pip(pip或pip3)。

由于某些原因,当我尝试安装未安装的任何软件包时出现此错误:

$ pip3 install pyqt3d
Exception:
 Traceback (most recent call last):
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-    packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in run
wb.build(autobuilding=True)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\req\req_set.py", line 487, in _prepare_file
req_to_install, finder)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\req\req_set.py", line 428, in _check_skip_installed
req_to_install, upgrade_allowed)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
  File "C:\Users\MonsterIguan\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\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
  File "C:\Users\MonsterIguan\Anaconda3\lib\site-packages\pip\index.py", line 728, in __init__
self.parsed = html5lib.parse(
AttributeError: module 'pip._vendor.html5lib' has no attribute 'parse'

我已经看到一些帖子有同样的问题但是没有确定的解决方案。我不熟悉pip / pip3,如果我再次尝试卸载并安装,我会害怕搞乱它。我仍然宁愿使用命令行来安装软件包而不是使用.zip文件夹手动安装。

(我试过cmd和git bash)

1 个答案:

答案 0 :(得分:1)

首次更新conda:

conda update conda

然后用conda更新pip:

conda update pip

作为经验法则。在尝试pip之前,请先使用conda。这通常会有所帮助。