cannot go to definition when using relative path for PYTHONPATH in .env #2841
Labels
area-editor-*
User-facing catch-all
area-intellisense
LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.
bug
Issue identified by VS Code Team member as probable bug
Environment data
Description of the issue
I work on a project were a python project is located on a subfolder of the root project, eg :
/my-project/docs
/my-project/docker
/my-project/app/src <---- the root of the python project
Following advices found here and there, I set a .env file in the root path (/my-project/.env) and set the PYTHONPATH using relative path
PYTHONPATH=./app/src
as advised in #955Most of the features seem to work ok (autocompletion, linting,...) however :
No definition found for xxxxx
Unable to open '__init__.py': File not found (file:///LOCAL-PATH/app/src/__init__.py).
(depending on the project. some just saysNo definition found for xxxxx
). The projects have the init.py file well located.So to have a workable environment, I have to set an absolute path in the .env file, which makes it non sharable / portable, which is not wanted.
The text was updated successfully, but these errors were encountered: