Add the virtual environment in Anaconda to jupyter notebook

Opening the initial jupyter notebook may only have the basic environment of Python 3 (ipykernel). If you want to use other virtual environments in Anaconda, please refer to the following steps:

  1. Win+R input cmd to open the computer terminal;

enter:

conda env list

(View all environments in Anaconda on your computer) Hit "Enter"

It will pop up as follows:

 

The one with "*" indicates the current environment;

2. Execute the command:

activate tensorflow

(What I added here is the tensorflow virtual environment)

Enter the virtual environment to be added.

Parentheses indicate the current environment.

3. Input:

pip install ipykernel ipython

Click: Enter

Just wait for the installation to complete.

4. Continue to enter:

ipython kernel install --user --name tensorflow

(behind the name is the name of the virtual environment to be added)

When appears:

It means that the tensorflow virtual environment has been successfully added.


Reopen jupyter notebook and you will see that it has been added successfully.

 

 

 

 

 

 

Guess you like

Origin blog.csdn.net/qq_58611650/article/details/126242313