2

When I write

from BeautifulSoup import BeautifulSoup

I am getting the following error:

No module named BeautifulSoup

All files are saved at project folder, subfolder BeautifulSoup. And it works well if BeautifulSoup.py placed at the same folder where main.py is.

proppy
  • 10,495
  • 5
  • 37
  • 66
LA_
  • 19,823
  • 58
  • 172
  • 308

1 Answers1

5

If you want to include BeautifulSoup from a subpackage (subdirectory), make sure that directory has a __init__.py file.

Afterwards from BeautifulSoup.BeautifulSoup import BeautifulSoup should work.

proppy
  • 10,495
  • 5
  • 37
  • 66