I can run test_pkg1.py and test_pkg2.py but when I run test.py Error occurred at test_pkg1.py
Exception has occurred: ImportError cannot import name 'a' from 'tools' (unknown location)
root ├─ pkg1 │ ├─ tools │ │ ├─ __init__.py │ │ └─ a.py │ ├─ __init__.py.py │ └─ test_pkg1.py ├─ pkg2 │ ├─ tools │ │ ├─ __init__.py │ │ └─ b.py │ ├─ __init__.py.py │ └─ test_pkg2.py ├─ test.py └─ d.py test_pkg1.py from tools import a test_pkg2.py from tools import b test.py from pkg2 import test_pkg2 from pkg1 import test_pkg1 https://stackoverflow.com/questions/66631532/cannot-import-name-a-from-tools March 15, 2021 at 10:10AM
没有评论:
发表评论