Reputation: 319
Hi I'm new to python and I would appriciate a second pair of eyes on this. I am currently refactoring a project to make it extensible.
The interperter encounters an error in main.py when trying to import an object called IrishTimesEventHandler from module located in a different package:
from alexaevents.irish_times_event_handler import IrishTimesEventHandler
ModuleNotFoundError: No module named 'alexaevents.irish_times_event_handler'
Hear is a snap of my directory:
The import statment in main.py looks like this:
from alexaevents.irish_times_event_handler import IrishTimesEventHandler
The venv directory is listed in sys.path.
I am using PyCharm community edition.
I am in the midle of refactoring using PyCharm, but as far as I can tell there are no circular dependencies.
Upvotes: 1
Views: 99
Reputation: 301
did you name the file name to irish_times_event_handler.py
or irish_times_event_handler
?
I think .py extension is required when you are importing a module
Upvotes: 3