私は次のディレクトリ構造を持っています
foo/
__init__.py
settings.py
bar/
__init__.py
myfile.py
myfile.pyには次のものがあります:設定のインポート
次のエラーが発生します:ImportError: No module named settings
、なぜですか?settings
どうすればファイルを効果的にインポートできますかmyfile.py
http://docs.python.org/2/tutorial/modules.html#intra-package-referencesから:
from .. import settings
それが役に立てば幸い