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

测试

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

相关推荐
GFCGUO2 小时前
Ubuntu18.04配置OpenPCDet并运行demo过程记录
linux·python·学习·ubuntu·conda·pip
white.tie2 小时前
vscode配置golang
ide·vscode·golang
mashagua4 小时前
本地访问autodl的jupyter notebook
ide·python·jupyter·autodl
cooldream20094 小时前
高效编程的利器 Jupyter Notebook
python·jupyter·jupyternotebook
一只积极向上的小咸鱼4 小时前
jupyter本地配置
ide·python·jupyter
4v1d4 小时前
Jupyter的使用分享
ide·python·jupyter
胡耀超5 小时前
知识图谱入门——7:阶段案例:使用 Protégé、Jupyter Notebook 中的 spaCy 和 Neo4j Desktop 搭建知识图谱
jupyter·知识图谱·neo4j·spacy·protégé
艾伦~耶格尔6 小时前
IDEA 配置 Git 详解
java·ide·git·后端·intellij-idea
HoneyMoose6 小时前
大厂笔试现已经禁用本地IDE怎么看
ide