forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
Labels
area-editor-*User-facing catch-allUser-facing catch-allarea-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug
Description
Environment data
- VS Code version: 1.28
- Extension version (available under the Extensions sidebar): 2018.9.0
- OS and version: ubuntu 18.04
- Python version (& distribution if applicable, e.g. Anaconda): python 3.6.6
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 #955
Most of the features seem to work ok (autocompletion, linting,...) however :
- if I try to 'go to definition' in the code, it just says
No definition found for xxxxx
- if I try to 'go to definition' on the import itself, it sometimes says
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.
chdsbd, micimize, kvdveer, wtyp, brianjmurrell and 2 more
Metadata
Metadata
Assignees
Labels
area-editor-*User-facing catch-allUser-facing catch-allarea-intellisenseLSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc.bugIssue identified by VS Code Team member as probable bugIssue identified by VS Code Team member as probable bug