I stumbled upon using a virtual environment in Python, so I'll leave it as a note. Also, I would like to summarize the points that I did not understand well when using the virtual environment with vscode.
To create a virtual environment, execute the code as follows.
$ conda create -n (Virtual environment name) python (Library name)
The virtual environment name can be any name you like. In the next python part you can also specify the version like python = 3.7
. If you enter the desired library name in the library name part, it will be installed when you create the virtual environment.
By doing this, I think that anaconda3 / envs / virtual environment name / python.exe will be added, so when switching the virtual environment with vscode, you should specify this exe file.
Also,
$ conda create -n env python anaconda
Then, anaconda will be installed when you create the virtual environment env.
Enabling the virtual environment
$ conda activate (Virtual environment name)
Disabling the virtual environment
$ conda deactivate (Virtual environment name)
You can do it with. You can also get a list of conda virtual environments by doing the following:
$ conda info -e
You can delete the virtual environment with the following command.
$ conda remove -n (Virtual environment name) --all
You can install the library with the following command.
$ conda install (Library name)
Recommended Posts