ImportError: cannot import name 'HTMLParseError' from 'html.parser'
yuvalbeck opened this issue · comments
ImportError: cannot import name 'HTMLParseError' from 'html.parser':
Last login: Mon Aug 14 19:43:49 on ttys000 User ~ % git clone https://github.com/raffaem/cs-dlp Cloning into 'cs-dlp'... remote: Enumerating objects: 4684, done. remote: Counting objects: 100% (233/233), done. remote: Compressing objects: 100% (115/115), done. remote: Total 4684 (delta 139), reused 197 (delta 117), pack-reused 4451 Receiving objects: 100% (4684/4684), 1.84 MiB | 1.08 MiB/s, done. Resolving deltas: 100% (2773/2773), done. user ~ % cd cs-dlp user cs-dlp % pip install --user . zsh: command not found: pip user cs-dlp % pip3 install --user . Processing /Users/user/cs-dlp Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: attrs>=18.1.0 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (18.1.0) Requirement already satisfied: beautifulsoup4>=4.1.3 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (4.1.3) Requirement already satisfied: browser-cookie3>=0.19.0 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (0.19.1) Requirement already satisfied: configargparse>=0.12.0 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (1.5.3) Requirement already satisfied: pyasn1>=0.1.7 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (0.5.0) Requirement already satisfied: requests>=2.20 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (2.31.0) Requirement already satisfied: urllib3>=1.23 in /Users/user/Library/Python/3.9/lib/python/site-packages (from cs-dlp==0.12.0b0) (2.0.3) Requirement already satisfied: lz4 in /Users/user/Library/Python/3.9/lib/python/site-packages (from browser-cookie3>=0.19.0->cs-dlp==0.12.0b0) (4.3.2) Requirement already satisfied: pycryptodomex in /Users/user/Library/Python/3.9/lib/python/site-packages (from browser-cookie3>=0.19.0->cs-dlp==0.12.0b0) (3.18.0) Requirement already satisfied: charset-normalizer<4,>=2 in /Users/user/Library/Python/3.9/lib/python/site-packages (from requests>=2.20->cs-dlp==0.12.0b0) (3.1.0) Requirement already satisfied: idna<4,>=2.5 in /Users/user/Library/Python/3.9/lib/python/site-packages (from requests>=2.20->cs-dlp==0.12.0b0) (3.4) Requirement already satisfied: certifi>=2017.4.17 in /Users/user/Library/Python/3.9/lib/python/site-packages (from requests>=2.20->cs-dlp==0.12.0b0) (2023.5.7) Building wheels for collected packages: cs-dlp Building wheel for cs-dlp (pyproject.toml) ... done Created wheel for cs-dlp: filename=cs_dlp-0.12.0b0-py2.py3-none-any.whl size=62981 sha256=0c107655acf909f6246af496ae547f858ae71a15d286e0ced48561e5edf94db4 Stored in directory: /Users/user/Library/Caches/pip/wheels/59/08/6d/49be50f7d78124cb8f845e3f02fe03d889293becee316d0ed2 Successfully built cs-dlp Installing collected packages: cs-dlp Attempting uninstall: cs-dlp Found existing installation: cs-dlp 0.12.0b0 Uninstalling cs-dlp-0.12.0b0: Successfully uninstalled cs-dlp-0.12.0b0 WARNING: The script cs-dlp is installed in '/Users/user/Library/Python/3.9/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed cs-dlp-0.12.0b0 user cs-dlp % /Users/user/Library/Python/3.9/bin/cs-dlp --cauth-auto safari modelthinking-004 Traceback (most recent call last): File "/Users/user/Library/Python/3.9/bin/cs-dlp", line 5, in <module> from cs_dlp.coursera_dl import main File "/Users/user/Library/Python/3.9/lib/python/site-packages/cs_dlp/coursera_dl.py", line 57, in <module> import bs4 File "/Users/user/Library/Python/3.9/lib/python/site-packages/bs4/__init__.py", line 29, in <module> from .builder import builder_registry File "/Users/user/Library/Python/3.9/lib/python/site-packages/bs4/builder/__init__.py", line 303, in <module> from . import _htmlparser File "/Users/user/Library/Python/3.9/lib/python/site-packages/bs4/builder/_htmlparser.py", line 7, in <module> from html.parser import ( ImportError: cannot import name 'HTMLParseError' from 'html.parser' (/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/html/parser.py) user cs-dlp %
Desktop:
- OS: macOS 13.4.1
- Browser safari
- Version 16.5.2
- Python Version - 3.9.6
pip install --upgrade beautifulsoup4
or pip3 install --upgrade beautifulsoup4
solved the issue