Conda environment not showing up in VS Code

I installed miniconda on Windows 10 and created an environment (I followed this guide: https://www.notion.so/shashankkalanithi/Setting-Up-Conda-Environment-ba83f7f019ea44b9af37588eed419eb9). However when I open the VS Code I don't see that environment python interpeter on kernel list. There is only one interpreter on the list: ~\Miniconda3\python.exe

How can I fix this?


Solution 1:

You can try to follow methods from vscode - Create a conda environment

Additional notes: ...To ensure the environment is set up well from a shell perspective, one option is to use an Anaconda prompt with the activated environment to launch VS Code using the code . command. At that point you just need to select the interpreter using the Command Palette or by clicking on the status bar.

Solution 2:

in vscode press ctrl+shift+p and type python:Select Interpreter you should see all the environment there. If it does not appear create a .py file and try again. also you can press the reload icon on the search bar where you typed python:select interpreter.

Solution 3:

Firstly you need to create an environment with python in it otherwise it won't recognize it. Create an environment like this first

conda create --name tf26 python==3.10

Use your preferred name and python version here thereafter restart VS Code. You will definitely see your env.

Note: You can delete any unused env if want like this

conda env remove --name <env_name>

Solution 4:

I wanted to use the new environment as a Jupyter kernel and had to install the jupyter package for it to show up in the kernel selection of VSCode. You can install it by running conda install jupyter.