You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
running python main.py will cause the following error:
> python main.py
Traceback (most recent call last):
File "C:\project\main.py", line 4, in <module>
import foo.b
File "C:\project\foo\b.py", line 4, in <module>
import a # no error
^^^^^^^^
ModuleNotFoundError: No module named 'a'
The text was updated successfully, but these errors were encountered:
@erictraut that's not related to this issue. the problem is that when running a python file as a module, the imports are not relative to the location of the file.
# foo/a.pya=1
# foo/b.pyimporta# no pyright error# should be `import foo.a`
> python -m foo.bModuleNotFoundError: No module named 'a'
there should be an option to disable that behavior imo, since many projects do not intend for all of their python files to be executed as scripts like that
running
python main.py
will cause the following error:The text was updated successfully, but these errors were encountered: