I have experienced a change in this problem and am posting for the benefit of others.
I named my example Python script bs4.py
Inside this script, whenever you try to import bs4 using the command:
from bs4 import BeautifulSoup , an ImportError was thrown, but the confusing (for me) import worked fine from an interactive shell in the same venv environment.
After renaming the Python script, the import works as expected. The error was caused by Python trying to import itself from a local directory rather than using a system copy of bs4
source share