使用 pip 时出错 - 模块 'pip._vendor.html5lib' 没有属性 'parse'
Error using pip - module 'pip._vendor.html5lib' has no attribute 'parse'
今天尝试使用 pip 安装一些软件包时出现此错误。 Python 版本 - 3.5.4
pip install pytesseract
它给出以下异常:
Collecting pytesseractException:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in ru
n
wb.build(autobuilding=True)
File "C:\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare
_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 554, in _prepar
e_file
require_hashes
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 278, in pop
ulate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirem
ent
all_candidates = self.find_all_candidates(req.name)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_cand
idates
for page in self._get_pages(url_locations, project_name):
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\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 更新命令也会出现此异常。 html5lib
版本为 0.999。以下代码似乎工作正常。
import html5lib
document = html5lib.parse("<p>Hello World!")
任何关于为什么会出现此错误的指示都会有所帮助。提前致谢。
我正在使用 anaconda,最近更新了 conda 和 anaconda,我收到了这个错误。
'conda update pip' 已修复
今天尝试使用 pip 安装一些软件包时出现此错误。 Python 版本 - 3.5.4
pip install pytesseract
它给出以下异常:
Collecting pytesseractException:
Traceback (most recent call last):
File "C:\Anaconda3\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "C:\Anaconda3\lib\site-packages\pip\commands\install.py", line 335, in ru
n
wb.build(autobuilding=True)
File "C:\Anaconda3\lib\site-packages\pip\wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 380, in prepare
_files
ignore_dependencies=self.ignore_dependencies))
File "C:\Anaconda3\lib\site-packages\pip\req\req_set.py", line 554, in _prepar
e_file
require_hashes
File "C:\Anaconda3\lib\site-packages\pip\req\req_install.py", line 278, in pop
ulate_link
self.link = finder.find_requirement(self, upgrade)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 465, in find_requirem
ent
all_candidates = self.find_all_candidates(req.name)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 423, in find_all_cand
idates
for page in self._get_pages(url_locations, project_name):
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 568, in _get_pages
page = self._get_page(location)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "C:\Anaconda3\lib\site-packages\pip\index.py", line 811, in get_page
inst = cls(resp.content, resp.url, resp.headers)
File "C:\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 更新命令也会出现此异常。 html5lib
版本为 0.999。以下代码似乎工作正常。
import html5lib
document = html5lib.parse("<p>Hello World!")
任何关于为什么会出现此错误的指示都会有所帮助。提前致谢。
我正在使用 anaconda,最近更新了 conda 和 anaconda,我收到了这个错误。
'conda update pip' 已修复