Another dirty but working workaround. Assumes you are on top level of your package.
import sys
from os.path import dirname, basename
if __package__ is None:
sys.path.append('..')
__package__ = basename(dirname(sys.argv[0]))
from . import your_module
The advantage vs another answer here is that you don't need to change imports which are autogenerated by IDE.