Kaushik S Kaushik S - 2 months ago 17
Python Question

ImportError: No module named bs4 in django

I am learning Django and I was working with bs4 in PyCharm on mac. I am using Python3 with Django which also has bs4 installed and it can be seen below.
enter image description here

But when I run the project, it throws me an error saying bs4 does not exist which can be seen below.
enter image description here

I have tried a lot of ways and it couldn't get it to work. Help

Answer

You are running the script with Python2.7 (according to the traceback) while having beautifulsoup4 package installed in Python3.5 environment.

Adjust your run configuration to use Python3.5 to run the script.