我正在使用Python 3.4
我克隆了一个git repo,其结构如下:
Parent_dir/
.
.#random things
.
Sub_dir/
Sub_dir1/
__init__.py
file1.py
Sub_dir2
__init__.py
file2.py
Sub_dir3
file3.py
__init__.py
file2.py的内容
from Sub_dir.Sub_dir1.file1 import attibute1 #OK
from Sub_dir.Sub_dir3.file3 import attribute1 #gives an error that there is no module named Sub_dir3
我尝试将__init__.py
文件添加到Sub_dir3但仍然给出了同样的错误。然后我试着尝试这个,所以我创建了自己的类似结构的项目,但在这种情况下一切正常。
在我正在使用的原始包装中是否有明显可以忽略的东西?
我的IDE是PyCharm。