我正在尝试使用从某处获得的代码。代码具有与此相当的结构:
project/
test.py
somepackage/
__init__.py
file1.py
file2.py
__init__.py
仅包含:
from file1 import *
from file2 import *
在test.py
我有
from somepackage import *
正在运行test.py
会出错:
AttributeError: module 'somepackage' has no attribute 'file1'
如果重要的话,我正在使用python版本3.5