Python 3: module in same directory as script: “ImportError: No module named”

The makesoup.py file is also located in the processors subdirectory, which means any Python script near it should be able to find it, right?

No. This feature was changed in Python 3 and that syntax no longer works.

Change the import makesoup to this:

from . import makesoup

Or to this:

from processors import makesoup

Both of these will make it impossible to run python processors/venues.py directly, though you can still do python -m processors.venues from your home directory.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)