【工具配置】【Jupyter】Windows下,为Jupyter创建新的kernel

在Windows下,为Jupyter创建新的kernel

目录

1.创建环境

  • 打开Anaconda Prompt
  • 输入以下代码创建环境
(D:\Users\拾夕\Anaconda3) C:\Users\拾夕>conda create -n KernelForJupyter python=3.6
  • 得到以下结果
The following NEW packages will be INSTALLED:

    certifi:        2016.2.28-py36_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    pip:            9.0.1-py36_1     https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    python:         3.6.2-0          https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    setuptools:     36.4.0-py36_1    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vc:             14-0             https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    vs2015_runtime: 14.0.25420-0     https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wheel:          0.29.0-py36_0    https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
    wincertstore:   0.2-py36_0       https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free

Proceed ([y]/n)? y

Linking packages ...
[      COMPLETE      ]|##################################################| 100%
#
# To activate this environment, use:
# > activate KernelForJupyter
#
# To deactivate this environment, use:
# > deactivate KernelForJupyter
#
# * for power-users using bash, you must source
#

2.激活环境以及安装必要的包

  • 输入以下代码激活环境
(D:\Users\拾夕\Anaconda3) C:\Users\拾夕> activate KernelForJupyter
  • 安装 ipykernel
(KernelForJupyter) C:\Users\拾夕>conda install ipykernel

3.创建新的kernel

  • 输入以下代码创建新的kernel
(KernelForJupyter) C:\Users\拾夕>python -m ipykernel install --name NewKernel
Installed kernelspec NewKernel in C:\ProgramData\jupyter\kernels\newkernel
  • 然后就可以在Jupyter中使用了
    在这里插入图片描述

4.Jupyter其他操作

  • 我们通过以下代码查看juypter kernel的其他命令
(KernelForJupyter) C:\Users\拾夕>jupyter kernelspec --help
Manage Jupyter kernel specifications.

Subcommands
-----------

Subcommands are launched as `jupyter kernelspec cmd [args]`. For information on
using subcommand 'cmd', do: `jupyter kernelspec cmd -h`.

list
    List installed kernel specifications.
install
    Install a kernel specification directory.
uninstall
    Alias for remove
remove
    Remove one or more Jupyter kernelspecs by name.
install-self
    [DEPRECATED] Install the IPython kernel spec directory for this Python
  • 例如我们可以通过以下指令查看当前环境下的kernel
(KernelForJupyter) C:\Users\拾夕>jupyter kernelspec list
Available kernels:
  python3      D:\Users\拾夕\Anaconda3\envs\KernelForJupyter\share\jupyter\kernels\python3
  newkernel    C:\ProgramData\jupyter\kernels\newkernel
  • 5
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值