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

测试

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

相关推荐
xin_yao_xin6 小时前
Conda 环境的 CUDA PATH 配置指南
开发语言·python·conda·cuda
Tian_Hang1 天前
Eclipse Ditto 的权限策略
java·服务器·前端·网络·ide·ubuntu·eclipse
yang_coder1 天前
juypter notebook启动ssl报错的处理记录
python·jupyter
Tian_Hang1 天前
Eclipse Mosquitto 安装及介绍
java·运维·服务器·ide·sql·mysql·eclipse
星云_byto1 天前
五分钟从零配置好VSCode + Claude Code + DeepSeek V4 Pro
ide·vscode·编辑器·cursor·codex·claude code·deepseekv4
诚信定制8392 天前
Typora插件开发指南:打造专属IDE式写作环境
ide
Tian_Hang2 天前
Eclipse Ditto 物模型相关代码
java·运维·服务器·ide·eureka·eclipse
Tian_Hang2 天前
Eclipse Ditto 节流机制
java·ide·eclipse
DogDaoDao2 天前
AI 编程 IDE 全景解析 2026:Agent 全面接管开发链路
ide·人工智能·程序员·ai编程·claude·cursor·ai agent
林熙蕾LXL2 天前
VSCode调试
ide·vscode·编辑器