Skip to content Skip to sidebar Skip to footer

How To Correct Use Import When Importing Neighbor Module

my projects directory looks that: -project -moduleA -a.py -__init__.py -moduleB -b.py -__init__.py in file a.py I want to import function f

Solution 1:

It is because import in a looks for /moduleB but moduleA doesnt have moduleB package in it. My suggestion is put another py file in project import and call function from there

-project
    -moduleA
       -a.py
       -__init__.py
    -moduleB
       -b.py
       -__init__.py
    main.py

Post a Comment for "How To Correct Use Import When Importing Neighbor Module"