Python — import the package in a module that is inside the same package

mod2.py is part of some_app. As such, it makes no sense to import the module, since you’re already inside it.

You can still import mod1. I’m assuming you need some_app/__init__.py to run. Not sure that’s possible.


EDIT:

Looks like from . import some_module will do what you’re after.

Leave a Comment

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