【经验总结】Jupyter 配置内核

1. 背景描述

使用 国家超算互联网中心 的服务器,创建

jupyterlab 容器,想在之前 conda 创建的环境中运行,可是不行,进入容器就直接进入 jupyterlab

2. 解决方法

配置内核

2.1 激活环境

bash 复制代码
conda activate peft

2.2 安装内核

bash 复制代码
pip install ipykernel -i https://pypi.tuna.tsinghua.edu.cn/simple
pip install ipywidgets -i https://pypi.tuna.tsinghua.edu.cn/simple

2.3 添加内核

bash 复制代码
~$ python -m ipykernel install --user --name=peft  --display-name peft
Installed kernelspec peft in /public/home/acc5trotmy/.local/share/jupyter/kernels/peft

查看内核

bash 复制代码
$ jupyter kernelspec list
Available kernels:
  python3    /public/home/acc5trotmy/.conda/envs/peft/share/jupyter/kernels/python3
  peft       /public/home/acc5trotmy/.local/share/jupyter/kernels/peft

此时启动页有了 peft 内核

3. 使用内核

打开任意 .ipynb 的python 代码,在右上方小甲虫旁边 选择内核

相关推荐
程序员爱钓鱼1 小时前
Python编程实战 · 基础入门篇 | 元组(tuple)
后端·python·ipython
程序员爱钓鱼1 小时前
Python编程实战 · 基础入门篇 | 列表(list)
后端·python·ipython
御承扬3 小时前
编程素养提升之EffectivePython(Builder篇)
python·设计模式·1024程序员节
chenchihwen4 小时前
AI代码开发宝库系列:FAISS向量数据库
数据库·人工智能·python·faiss·1024程序员节
allnlei5 小时前
使用CLion进行远程开发(Remote Development)
ide·1024程序员节
zandy10115 小时前
2025年AI IDE的深度评测与推荐:从单一功能效率转向生态壁垒
ide·人工智能
AI视觉网奇5 小时前
json 可视化 2025 coco json
python·1024程序员节
mit6.8246 小时前
[nanoGPT] ChatGPT 的 LLM 的全栈实现 | 快速上手
python
DKunYu6 小时前
2.1线性回归
pytorch·python·深度学习·1024程序员节
大飞记Python6 小时前
实战分享:一键自动化下载指定版本的Chrome及Chromedriver(附Python源码)
chrome·python·自动化