Mac 安装jupyter报错zsh: command not found: jupyter

环境

机型:Apple M1 Pro
python: 3.10

jupyter安装

https://jupyter.org/install

pip install jupyterlab
pip install notebook
jupyter notebook

问题

运行jupyter notebook时报错zsh: command not found: jupyter

解决方案

打开.zshrc,添加jupyter的环境,路径查看可以使用pip show jupyter,你可能看到输出如下:

Name: jupyter
Version: 1.0.0
Summary: Jupyter metapackage. Install all the Jupyter components in one go.
Home-page: http://jupyter.org
Author: Jupyter Development Team
Author-email: jupyter@googlegroups.org
License: BSD
Location: /Users/xxx/.local/lib/python3.10/site-packages
Requires: ipykernel, ipywidgets, jupyter-console, nbconvert, notebook, qtconsole
Required-by: 

其中Location就是jupyter的安装路径,jupyter的命令脚本在和lib同级目录的bin目录。

vim .zshrc

在最后一行追加

export PATH=/Users/xxx/.local/bin:$PATH

使配置生效

source .zshrc

重新打开终端执行jupyter notebook,jupyter就可以打开了,搞定收工。
在这里插入图片描述

  • 9
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值