Use the new environment in jupyter notebook

1. Create the environment

Create: conda create -n environment name, such as,

conda create -n py39 python=3.9

2. Install ipykernel, otherwise it will be reported that there is no ipykernel

pip install ipykernel

3. Execute configuration

python -m ipykernel install --name py39

There may be an error

insert image description here
Solution
Add –user to the installation command to solve the problem, the command is as follows

python -m ipykernel install --user --name py39

insert image description here

Appendix Common commands

查看所有虚拟环境: conda info -e 

启动虚拟环境:activate 环境名

创建:conda create -n 环境名 ,如,conda create -n rcnn python=3.6

删除:conda remove -n rcnn --all

Guess you like

Origin blog.csdn.net/HHTNAN/article/details/125497907