pip


AttributeError: module ‘html5lib.treebuilders’ has no attribute ‘_base’

Recently, we were receiving the above error on a GNU/Linux Ubuntu 20.04 LTS.

AttributeError: module 'html5lib.treebuilders' has no attribute '_base'

We had installed beautifulsoup4 and html5lib using pip. To solve the issue, we had to uninstall the html5lib that was installed by pip and install it through apt.

# Remove html5lib if you have installed it with pip3:
pip3 uninstall html5lib;

pip3 install --upgrade beautifulsoup4
sudo apt-get install python3-html5lib

youtube-dl ERROR: unable to download video data: HTTP Error 403: Forbidden

Recently, we were getting the following error in youtube-dl :

ERROR: unable to download video data: HTTP Error 403: Forbidden

We weren’t sure what that error meant (in the case of youtube-dl as the video is public) so we updated pip and youtube-dl to be sure that our problem was not that. The commands we used were the following:

python -m pip install --upgrade pip;
pip install --upgrade youtube-dl;

After the updates, we still got the same error… After some google-fu we read that it could be a caching issue! We cleared the cache as follows:

youtube-dl --rm-cache-dir;

Guess what? After that, the problem was resolved and we were able to reuse youtube-dl.