If your file structure is as follows:
myproject/
__init__.py
call_participant.py
lib/
__init__.py
lib_add_participant.py
In this case, your __init__.py
files can be empty, if you like (or they can define any number of things - see this fine answer from Alex Martelli for more details.
then you can add it by using
from .lib.lib_add_participant import LibAddParticipant
However, if call_participant.py
is your end script, then this tactic will not work, because you "can't do a relative import in a non-package", as the interpreter will tell you. In that case, your best bet (in my opinion, at least) is to make lib
into a package in your python path (either in your site-packages directory, or in a path referred to by your pythonpath
environment variable).