Replies: 1 comment 4 replies
-
Converting this from a bug report to a discussion since it's a question. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am having a really hard time understanding how to make
Pyright
see my internal imports. My project is structured like this:In
b1.py
, for example, I want to use a class fromfolder_a
, so I writeRunning the
driver_script.py
from the rootproject
directory works just fine like this, but in my editor,Pyright
is telling me that this import cannot be resolved. If I change the import to a relative import, e.g.then
Pyright
is happy, but then runningdriver_script.py
throws the exceptionAttempted relative import beyond top-level package
and crashes.I have tried numerous strategies from reading documentation to Google searches, trying to create
pyproject.toml
and/orpyrightconfig.json
, usingexecutionEnvironments
and all sorts of other things but I just can't getPyright
to be happy with these imports.Could someone please help me understand what I am missing here? I know this is a common problem but I just can't figure it out.
Beta Was this translation helpful? Give feedback.
All reactions