mYoungs' Blog

I love, therefore I am.

0%

OS X下安装jupyter并且解决zsh: command not found: jupyter

安装python 和 pip 就不多说了,不会的童鞋,看后面的内容也意义不大,直接进入正题:

  1. 安装jupyter

    pip install jupyter

  2. 正确的话会提示安装成功

  3. 启动

    jupyter notebook

  • 然鹅,此时问题出现了:

    “zsh: command not found: jupyter”

  • 不要慌,分析一下:

    pip3 show jupyter

    返回

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    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: [email protected]
    License: BSD
    Location: /Users/******/Library/Python/3.7/lib/python/site-packages
    Requires: jupyter-console, notebook, ipywidgets, qtconsole, nbconvert, ipykernel
    Required-by:

看上去是傻逼的自带python环境问题,不纠结这个,加个环境变量试试;
根据提示:

Location: /Users/yourusername/Library/Python/3.7/lib/python/site-packages

处理一下成为bin的路径

export PATH=/Users/**/Library/Python/3.7/bin:$PATH

加到zsh的环境变量里

vim .zshrc

source一下生效

source .zshrc

等灯等灯 okk啦