menu

Questions & Answers

Installing html5lib for Python on Ubunto

Dependencies on html5lib are pretty broad across developer tools on Linux. I uncovered this issue while attempting to implement the selenium test suite for my Django app. When I attempt to pip install, I receive the below error. How do I adjust my system to grab and install html5lib?

    Traceback (most recent call last):
File "/home/satch/.local/bin/pip", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3/dist-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/usr/lib/python3/dist-packages/pip/_internal/commands/__init__.py", line 104,   
in create_command
module = importlib.import_module(module_path)
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/pip/_internal/commands/install.py", line 24, 
in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/usr/lib/python3/dist-packages/pip/_internal/cli/req_command.py", line 16, 
in <module>
from pip._internal.index.package_finder import PackageFinder
File "/usr/lib/python3/dist-packages/pip/_internal/index/package_finder.py", line 21, 
in <module>
from pip._internal.index.collector import parse_links

File "/usr/lib/python3/dist-packages/pip/_internal/index/collector.py", line 14, 
in <module>
from pip._vendor import html5lib, requests
ImportError: cannot import name 'html5lib' from 'pip._vendor' 
(/usr/lib/python3/dist-packages/pip/_vendor/__init__.py)
Comments:
2023-01-23 00:55:09
Although I apparently installed html5lib from git with the following commands, I am still getting the html5lib import error when I try to install django-crispy-forms: satch@satch-YOGA-910:~$ sudo apt-get install git satch@satch-YOGA-910:~$ git clone github.com/html5lib/html5lib-python
2023-01-23 00:55:09
I get the same html5lib import error when I attempt to install selenium.
2023-01-23 00:55:09
satch@satch-YOGA-910:~$ pip install selenium
Answers(0) :