可以每个环境都安装自己的jupyter
1、 安装
- Anaconda安装,其会自动在base中安装 无需再其他环境再安装
- 自己在自己的python环境中安装:激活环境后:(多个环境都安装,则可以激活哪个环境后打开jupyter即会用该环境运行)这种方式无法实现同一notebook环境的切换
pip install jupyter -i https://pypi.tuna.tsinghua.edu.cn/simple
2、 启动方式: - 使用任意位置激活环境后输入: jupyter notebook (这样打开的工作路径为c盘user的路径)
- cd到目标文件夹下 使用 jupyter notebook命令就会以当前目录作为工作目录打开Jupyter
- 或者使用jupyter lab(复杂) 同样有效
win11需要这样切换盘符:
Anaconda中多个环境不需要每个环境都安装jupter
新环境使用下面命令使自己的环境添加到base安装的jupyter notebook中:
1、 激活环境
2、 pip install ipykernel --user -i https://pypi.mirrors.ustc.edu.cn/simple/
3、 python -m ipykernel install --user --name spy_pytorch1.10 --display-name "Python (spy_pytorch1. 10)"
a) 上述的xxx位置替换为你自己环境的名字
4、cmd到自己的文件夹位置 输入jupyter notebook
在菜单栏Kernel->Change Kernel位置。
这样就可以在jupyter中运行时使用自己创建的环境了!