background
Created a python Virtual runtime environment for , for instance tensoflow, Want to be in VS Code Run debugging under .
Refer to instructions :https://blog.51cto.com/u_15127658/2783413
(1) download VS Code
(2) install Python plug-in unit
See the previous instructions for creating a virtual environment . By default, it has been created .
stay VS Code For in the python Program management does not VS Medium engineering 、 Concept of solution , But there are similar things to refer to .
(3) Will include python File folder add python in . As shown in the figure below :
Be careful ,
(4) choice Python Interpreter
Python It's an interpretive language , In order to be able to run Python Code , We need to tell VisualStudio Code Which one to use Python Interpreter .
start-up vscode, adopt Ctrl+Shift+P Open the command panel , Then type and execute Python:Select Interpreter command .
Pictured above ,vscode All available... On the current machine are automatically listed Python Interpreter . among , The suffix is (’base’:conda) Yes. Anaconda Of Python Interpreter .
Select an applicable python.exe after ,vscode Will python.exe The path to is stored in the workspace settings . Located at the root of the project .vscode In the folder settings.json file . You can also modify it directly python.pythonPath This path .
Here's the picture ,:
enter after , Select the corresponding folder .
Press Enter after , Select the corresponding virtual environment .
(5) Running environment settings , Choose your own project .
Then a configuration file will be created launch.json, Here's the picture .
You can click Run python Procedure !!!