#How to change workspace to python in visual studio code code
My problem was similar in that I wanted code to find my custom modules for import in a script. env file and the vscode set up so that it finds and reads some custom module files. OP seemed to have asked about path syntax for the.
Shame that we just have to work around this, but the autocomplete helps a lot when writing the import statements to begin with. To replicate this behavior with pylint, add this to your settings.json: "": [ Snooping around linting settings, the defaults for mypy include -ignore-missing-imports. Nothing I do to launch.json regarding PYTHONPATH makes any difference to pylint, which will red-underline from modules import mod, despite the fact I can put the cursor on mod, hit F12, and the file opens. Note that any changes to the settings.json file will require that you exit the integrated terminal and restart it. The working directory will be your project root. So if any of your scripts do anything with paths relative to their location in the tree, they won't work. I create a default launch.json file to "run the current file". VSCode is a great editor, but everywhere else, it falls short, in my opinion. So my PYTHONPATH needs to be set to ~/project/ (something that P圜harm does automatically). In script.py, I have from modules import mod. My python project is laid out as follows: ~/project/
I want a script to import a module from another directory. I have a situation that I believe is relatively common.