0
私の構造辞書は、私がfile1.py/
file1.pyのfolder1するフォルダ2から輸入file4.pyが必要のpython3インポートモジュール
mainFolder
folder1
__init__.py
file1.py
file2.py
folder2
__init__.py
file3.py
file4.py
setup.py
__init__.py
です:
from ..folder2.file4 import MyClass
をし、私は得る:
SystemError: Parent module '' not loaded, cannot perform relative import
それを修正する方法?
セットアップはトップパッケージの外にある必要があります。 –
スクリプトの実行方法を表示します。 –
[10億回目の相対インポート]の可能な複製(https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time) –