Skip to content Skip to sidebar Skip to footer

Absolute Import Results In Modulenotfounderror

Python 3.6 I've written some components and I'm trying to import one of them in the other. Below is what my project structure looks like: . └── components ├── __in

Solution 1:

Ok, imports require the top level package to be available in Python PATH (sys.path).

So to make it work, you should:

  • cd to the directory containing components
  • add . to the Python PATH:

    export PYTHONPATH='.'
  • launch your script:

    python components/extract/python3/extract.py
    

On my system, it successfully displays:

Found me

Post a Comment for "Absolute Import Results In Modulenotfounderror"