Jupyter | jupyter notebook 使用 conda 环境

博客使用更佳 点我进入博客

创建虚拟环境

在 Anaconda Prompt 里面输入:

shell 复制代码
conda create -n env-name

并且输入 y 确认。例如我们创建环境名为 jupyter

激活环境

shell 复制代码
conda activate env-name

激活之后发现环境从 base 变为 jupyter(笔者用的 env-name 为 jupyter)

安装内核

在创建的环境下

shell 复制代码
conda install ipykernel
python -m ipykernel install --user --name env-name --display-name "name"

比如我们的

shell 复制代码
python -m ipykernel install --user --name jupyter --display-name "Python (jupyter)"

显示这个说明安装成功

在创建虚拟环境的文件夹下打开 jupyter notebook

shell 复制代码
jupyter notebook

创建一个新的 notebook,选择内核的时候看到我们刚才安装的 jupyter 说明成功了。然后选中它进行切换。

也可以在这里进行切换内核

下载一些 python 包,在这个虚拟环境下进行下载

例如我们要安装 numpy

测试

并没有报错,说明安装成功

相关推荐
饭来_17 小时前
Ubuntu 中出现 CondaToSNonInteractiveError 的解决方法
ubuntu·conda·debug
golang学习记1 天前
VSCode多光标迎来重大更新
ide·vscode·编辑器
53488736abcdefg1 天前
Anaconda+Jupyter+NumPy
jupyter·numpy·anaconda
夜雪一千1 天前
如何取消PyCharm自动识别test开头文件并进入测试模式
ide·python·pycharm
小李不困还能学1 天前
PyCharm远程开发连接失败排查与解决
ide·python·pycharm
测试开发Kevin1 天前
IDEA工程结构解析:项目、模块、库、Facet、Artifact (工件) 概念说明
java·ide·intellij idea
小李不困还能学1 天前
VSCode远程开发免密码登录
ide·vscode·编辑器
kite01212 天前
TraeCode 与 TraeWork 合并:AI 时代 IDE 的三种形态与未来开发工具
ide·ade·traework·traecode
weixin_461769402 天前
VS Code 中创建 Jupyter 文件(.ipynb)
ide·python·jupyter
浪潮IT馆2 天前
Android Studio 非最新版本下载安装教程
android·ide·android studio