How to switch jupyter to other configured conda virtual environment and vscode import conda environment

The first step is to view the virtual environment:

conda env list


The second step is to install nb_conda (after completion, there will be more conda tags on the jupyter webpage)

conda install nb_conda

The third step is to activate the environment

conda activate cvml

The fourth step is to install the ipykernel module

conda install ipykernel

Step 5: python -m ipykernel install --name cvml

After the installation is complete, a cvml folder will be automatically generated in the C:\ProgramData\jupyter\kernels directory

After the above is completed, open jupyter to create a python file

在kernel——>change kernel——>python[conda env:cvml]

That's it


vscode's words: very simple

Please see the picture below:

File -> Preferences -> Settings: Enter python path

Find Python Conda Path

Put the address of the python.exe file in the conda virtual environment you created in the input box below.

This is it

Note that vscode does not support Chinese paths


Another way is to open the view -> command panel and enter python s

Choose the right interpreter

ok

Guess you like

Origin blog.csdn.net/weixin_51267929/article/details/114123606