python - Importing modules from different directories -


I have trouble importing a module: it belongs to the directory ./ dao and code He calls that he is ./ core here. Represented as schematically:

  rnaspace / __init__.py core / __init__.py logger.py claims / __init__.py storage_configuration_reader.py  

This error is message:

  traceback (most recent call final): file "logger.py", line 21, & lt; Module & gt; The rnaspace.dao.storage_configuration_reader import storage_configuration_reader ImportError: No module named rnaspace.dao.storage_configuration_reader  

This file is There /rnaspace/dao/storage_configuration_reader.py and In the same folder, the __init __ py file is as follows:.

  "" ""  < "package claims that plateform data access files gathers" / Pre> 

If I understood well, then he should act. I think the problem is that there is no subdirectory of another (or this is not the way most), there is a way to go around it? Or do I need to apply the solution?

Edit __init __ of the rnaspace folder. Py file:

    

scr def update_conf (conf_path, predictors_conf_dir) imports as rnaspace.dao.storage_configuration_reader = "text">
  Import from storage_configuration_reader  

it wrong is a "storage_configuration_reader" directory as "claims" directory

this is how it should be:

  rnaspace.dao import   

edit:

or like this:

  import Not rnaspace.dao.storage_configuration_reader  

Comments