abhi8893 / Titanic-Survival

Titanic Survival Kaggle competition
0 stars 0 forks source link

Running modules with -m flag raises RunTimeWarning due to double import #20

Open abhi8893 opened 4 years ago

abhi8893 commented 4 years ago
(titansurv) abhi@hpx360:~/main/coding/Python-code/mygit/Titanic-Survival$ python -m titansurv.pipeline.pipeline1

OUTPUT

/home/abhi/main/coding/Python-code/mygit/Titanic-Survival/titansurv/pipeline/data_pipeline.py:42: UserWarning: Please set the data first using set_data method!
  warnings.warn('Please set the data first using set_data method!')
/home/abhi/miniconda3/envs/titansurv/lib/python3.8/runpy.py:126: RuntimeWarning: 'titansurv.pipeline.pipeline1' found in sys.modules after import of package 'titansurv.p
ipeline', but prior to execution of 'titansurv.pipeline.pipeline1'; this may result in unpredictable behaviour
  warn(RuntimeWarning(msg))

Look into these: http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#the-double-import-trap https://stackoverflow.com/questions/43393764/python-3-6-project-structure-leads-to-runtimewarning