I want to use the BeautifulSoup4 in PyCharm 2018.3.2. Problem is, "bs4" and "BeautifulSoup"/"BeautifulSoup4" is underlined red in PyCharm when writing:
from bs4 import BeautifulSoup (or BeautifulSoup4)
Nothing else fails to import, only this module. The red underlining tells me the same for "bs4" and "BeautifulSoup(4)":
"Unresolved reference 'bs4' less... (Ctrl+F1)
Inspection info: This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items"
When I run PyCharm the error says: "ModuleNotFoundError: No module named 'bs4'"
In cmd pip3 has installed everything correctly. Had to uninstall and install several times just to be sure. Atm it looks like this after installation:
Python cmd. Not in administation mode here, but tried that too
Also, this:
pip check bs4
pip check beautifulsoup4
says: "No broken requirements found."
I'm fairly new to python, but I've searched the web for answers but found nothing with the "unresolved reference". Thought maybe the path was to blame, but recently installed requests and the modules are placed in the same folder in my archive so PyCharm should be able to find bs4 when it's able to find requests.
You can easily install BeautifulSoup4 from inside PyCharm.
First go to File >> Settings.

Then on the left side scroll down, expand the Project entry and click on Project Interpreter.

Now you can verify the settings on the right side of the window. For example, what packages are installed and which interpreter version is currently set.
Note: If you have several interpreters with different versions installed, make sure you've selected the right interpreter.
On the right side click on the + symbol (add package). In the search input line type beautifulsoup4 and click on it in the list below.

Finally at the bottom click on Install Package and wait for the promt that it has installed successfully.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With