Module b
in the package will import module a
. If I import this package in c.py and run module b
, it will report an error.
No module named 'a'
How should I modify it?
a.py:
def a():
print('a')
b.py:
import a
a.a()
c.py:
import package.a
import package.b
Directory structure:
main/
c.py
package/
__init__.py
b.py
a.py