hope this fix your issue We have to distinguish the two notions: the "working directory" and the "python environment". When you go into VS code from Anaconda, then you are in an Anaconda virtual python environment and it's default directory. You can test it with upon-left first icon - "Explorer". Here you will find a directory structure, where your .py file actually is. But sometimes the file what the .py searching for could be in some quite other directory. If you want to run a python program with some additional files stored in a common directory, then I prefer to use some variable to set the working directory:
I wish this helpful for you The issue you are having is that you may not have looked into what Anaconda is used for or what it solves. This step was pointed out in the installation steps when it adds Anaconda to your PATH. Being that Anaconda installs Python and has "environments" there is no reason to have 2 versions of the Python installation on your system, but Anaconda allows you to have different versions of Python with environments. Only one can use the "Python" command unless you execute it from the python.exe directory or make a separate alias as the python command and point it to the Anaconda or other Python installation. Again this is pointless as you can create a new environment with your Django project and requirements. In short, having 2 separate Python installations is pretty much taking away what Anaconda helps solve.
it helps some times It isn't that the extension can't find the netifaces package, it's that Pylint can't. Make sure that the Pylint you are having the extension run for you is installed into the same conda environment that you are running from (e.g. make sure you didn't set python.linting.pylintPath to something outside of your conda environment). Also make sure that ipython is from the same environment as well (e.g. you are using a conda environment and launched the terminal with the Python: Create Terminal command).
How do I change the default directory of Anaconda?
may help you . You have to know where the file is, and then you can copy your route to cmd and by using cd you will be in the route, then you can use py filename.py. (You need to have py installed in path) Also, you can use ctr+shift+c on vscode to open the working directory in cmd.
How to change the default working directory in python