How to import python module from within the project in blender?
For blender below 2.8

The script to be imported must have the '.py' suffix (e.g. loggingConfig.py), it can be imported as follows:

import loggingConfig


If loggingConfig suffered any changes, you must reloaded, like this:

import loggingConfig

# The following lines reload the module in each run
import imp
imp.reload(loggingConfig)


This can be ran each time to ensure to have always the most up to date version of loggingConfig.py.

For blender >= 2.8

The script to be imported does not need to have the '.py' suffix (e.g. loggingConfig), it can be imported the following:

import bpy

loggingConfig = bpy.data.texts["loggingConfig"].as_module()


In this case it isn't necessary to reload the script in each run.