Closed nhumrich closed 7 months ago
@nhumrich Did you import main.py
in app.__init__.py
?
I tried doing that, and it didn't fix the problem.
@nhumrich I can reproduce the following error if I don't import main.py
in app.__init__.py
:
run.py:1:17-21: error: cannot import name 'main' from 'app.__init__'
run.py:4:5-15: error: no module named 'main'
If I import it, the issue is no longer reproducible. Here is a minimal reproducible example: root.zip
Imports do not seem to work on a basic python project.
It is common for a python project to be packaged as a module. In order for imports to work correctly, typically the entry point script is a very basic python file that imports the main function from a module.
For example, my directory:
And in my run.py, I have:
When I run this with codon:
codon run run.py
I get the following error: