Python cannot import from __main__

Describes the cause and action for error messages.


Error Message(English):
cannot import from __main__

Resolution


関連リンク


Traps for the Unwary in Python's Import System ? Nick Coghlan's ...
http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html

[Python] importの躓きどころ - Qiita
https://qiita.com/ysk24ok/items/2711295d83218c699276

Cannot import local module in Python despite trying multiple ...
https://stackoverflow.com/questions/48971427/cannot-import-local-module-in-python-despite-trying-mul・・・

"cannot import name '__main__" when trying to run a console ...
https://stackoverflow.com/questions/48482956/cannot-import-name-main-when-trying-to-run-a-console-co・・・

Python unable to import custom module despite having ...
https://stackoverflow.com/questions/9101698/python-unable-to-import-custom-module-despite-having-ini・・・

Relative imports for the billionth time
https://stackoverflow.com/questions/14132789/relative-imports-for-the-billionth-time

Sibling package imports
https://stackoverflow.com/questions/6323860/sibling-package-imports

Hitchhiker's guide to the Python imports | There is no magic here
https://alex.dzyoba.com/blog/python-import/

Python __init__.py & modular Imports ? Ramraj Chandradevan ...
https://medium.com/@ramrajchandradevan/python-init-py-modular-imports-81b746e58aae

python3 - Running Pip3 ImportError: cannot import name 'main ...
https://askubuntu.com/questions/1025793/running-pip3-importerror-cannot-import-name-main



Name:
Comment:



[return to Python エラーコード一覧]