I am working on a python project via VS Code remote ssh access.
The Structure of the project is roughly equal to the following:
Project/
├─ src/
│ ├─ folder1/
│ │ ├─ subfolder/
│ │ │ ├─ new_file.py
│ ├─ file.py
├─ .gitignore
When executing the python files, I always have to specify the PYTHONPATH because otherwise imports are not found.
Additionally new_file.py creates data that that is supposed to be saved in folder/subfolder/out (seen relatively to the src folder), however when executing folder/subfolder/out is created in relation to the Project folder instead of src.
When using PyCharm this problem can simply be solved by marking the src folder as src. How can I achieve this using VS Code?
I tried suggestions from How to set the root directory for Visual Studio Code Python Extension? however they didn’t help in terms of not changing the behaviour in any kind.
user25170336 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.