Import bs4 could not be resolved from source Pylance - Help?

Sounds like bs4 is not installed in the same path as your python interpreter. If you haven't set up a virtual environment, I recommend doing that. Open the terminal tab in VSCODE, and enter the following. If you have Mac/Linux (Windows), enter: python3 -m virtual-env --version (Windows: python.exe ...) cd /path/to/your/project python3 -m virtual-env venv (Windows: python.exe ...) source venv/bin/activate (Windows: ./venv/Scripts/activate.bat) pip install beautifulsoup4 (and what ever other external libraries you want to use)

Finally, set the interpreter path in VSCode to /venv/bin/python3 (Windows: /venv/Scripts/python.exe)

Alternatively, you could use an IDE that will help you set up a virtual environment and manage your packages for you, like PyCharm Community version, which is more beginner friendly than VSCode.

/r/learnpython Thread