jupyter | jupyter使用conda虚拟环境

一. 首先创建虚拟环境&&进入到你已经搭建好的虚拟环境中
bash 复制代码
# 创建一个名为jupyter_test的conda虚拟环境
conda create -n jupyter_test python=3.7.5

# 进入/激活虚拟环境
conda activate jupyter_test
二. 安装jupyter(conda自带)和内核, 将环境添加进内核
bash 复制代码
pip install jupyter
pip install ipykernel  # 安装jupyter内核

# 添加虚拟环境到jupyter中
python -m ipykernel install --user --name 虚拟环境名 --display-name 在jupyter中显示的环境名称
三. 移除内核环境
bash 复制代码
jupyter kernelspec remove 环境名
四. 如果conda虚拟环境中第三方包发生了变化,需要将jupyter中的内核环境移除重新进行添加
1. 移除
bash 复制代码
jupyter kernelspec remove 环境名
2. 重新添加
bash 复制代码
# 添加虚拟环境到jupyter中
python -m ipykernel install --user --name 虚拟环境名 --display-name 在jupyter中显示的环境名称
相关推荐
你住过的屋檐2 分钟前
【Nginx】linux上安装nginx
linux·运维·nginx
宵时待雨27 分钟前
linux笔记归纳17:传输层协议UDP
linux·笔记·udp
SCandL1522 小时前
k8s service
linux·容器·kubernetes
会飞的土拨鼠呀3 小时前
Linux的存储使用率应该如何计算
linux·运维·服务器
weixin_511255214 小时前
NGINX常用配置
linux·服务器·nginx
昌原的儿子LEO5 小时前
进程和线程(2)
linux·服务器·网络
会飞的土拨鼠呀6 小时前
Linux 真实内存使用率的核心计算标准
linux·运维·服务器
cooldream20097 小时前
Conda 镜像源 404 错误完全解决指南
conda·ai编程
陈年老古董7 小时前
CentOS编译安装Python3.11完整教程
linux·笔记·学习·centos·python3.11
深念Y7 小时前
为什么选 Go:直观、可维护、AI 友好
linux·开发语言·人工智能·golang·agent·harness