1

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
  • @SharimIqbal OP is asking "a module in a specific version of python", not "a specific version of a module". Commented May 1, 2022 at 12:00
  • 1
    Using the pip module directly by the python-interpreter that you want to install on, you can do just that: <python-interpreter> -m pip install <python-package> Commented May 1, 2022 at 12:02

2 Answers 2

1

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

Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.