I have a Python project in VSCode. Its structure
root
+-- docs
+-- some_other_folder
+-- src
+-- app
| +-- main.py
+-- tests
+-- conftest.py
conftest.py
has import
from app.main import app
My task is to set src
as root folder because in otherwise I got a warning Import 'app.main' could not be resolved
Create pyrightconfig.json
at the the root directory of your project
Add the following config:
{
"executionEnvironments": [
{"root": "src"}
]
}
Details taken from: https://github.com/Microsoft/pyright/blob/master/docs/configuration.md
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With