python 2.7 - __init__.py in current working directory -


i have directory structure

log_dedupe ├── dedupe │   ├── __init__.py │   ├── __init__.pyc │   ├── sha_dedupe.py │   ├── sha_dedupe.pyc │   └── test_sha_dedupe.pyc ├── globals.py ├── globals.pyc ├── __init__.py ├── __init__.pyc ├── log_dedupe_main.py ├── log_dedupe_main.pyc 

in log_dedupe_main.py

from log_dedupe import parse_arguments 

results in

importerror: no module named log_dedupe 

if added setup.py , install package don't error anymore. if change in init.py have reinstall.

note considered importing __init__ in files wasn't sure if idea or not.

having wasted hour of time find myself wondering if there's way either

  1. override current working directory use directory name rather ''
  2. automagically install python package if file has been changed.

change directory log_dedupe/ in , invoke log_dedupe_main.py follows:

python -m log_dedupe.log_dedupe_main` 

or better yet, rename log_dedupe_main.py __main__.py , invoke follows:

python -m log_dedupe 

Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -