I am facing a rather minor problem where I am unable to use the Library ‘Beautifulsoup4’. I use VSCode as IDE and use a Venv with Python Version 3.12.2. Everytime I try to run my programm it gives me the error:
ModuleNotFoundError: No module named 'bs4'
To import Beautifoulsoup I use the import command, which even gets recognized and suggested, when trying to type it, by the IDE:
import bs4
At first I have successfully activated my venv in the terminal via:
.venv/scripts/activate
Then I have tried to install the Library via Pip:
pip install beautifulsoup4
and
pip3 install beautifulsoup4
After trying to install it via pip I was able to find the Library inside the folder of the "Lib" folder of the venv. But it still did not work. I have tried to uninstall and reinstall it multiple times but it was still not working.
I have already check and see that I was using the right interpreter and I was.
2
Answers
please use
and then use
beautifulsoup4
is not installed) instead of particular venv (where you have already installed this package). To tell VSCode to use the particular venv set thepython.defaultInterpreterPath
option in your.vscode/settings.json
file – link(see
python.terminal.activateEnvironment
option too)bs4
according to "Quick start" section –from bs4 import ..