I am trying to install html5lib, a module of bs4, but I get Couldn't find a tree builder with the features you requested: html5lib. Do you need to install a parser library? error, when I say "pip install html5lib" on the cmd menu it says it is already installed on "c:\users\dell\appdata\local\programs\python\python38\lib\site-packages" I am thinking that the problem is pip installing it in0 python3.8 instead of 3.9.1 which is the version I'm using. I tried pip3, pip, pip-3.9 but none worked. I tried copy pasting the html5lib folder by going to 3.8's folders and pasting it into the 3.9 folder but I didn't know where to paste it. I tried deleting the 3.8 version but then the pip command stopped working. Please help
2 Answers
I believe that in windows you can do
py -<python-version> -m pip install <module>
for example :
py -3.9 -m pip install html5lib
The thing is if you use pip install etc it takes the first python interpreter it finds in the PATH so another way to do it is to put the interpreter version you use the most at the top of your PATH
Comments
It is always preferable to create a virtual environment and then install the packages required where you can create virtual environment based on version of python you use.
python -m venv The virtual environment based on mentioned version can be installed if that version is installed in your system.
Here in virtual environment you can keep track of libraries installed and install required libraries accordingly.
pipmodule directly by the python-interpreter that you want to install on, you can do just that:<python-interpreter> -m pip install <python-package>