美文网首页
mac OSX 10.14.4安装jupyter

mac OSX 10.14.4安装jupyter

作者: 宁大通信狗 | 来源:发表于2019-04-12 02:18 被阅读0次

    1.本文假设读者已经安装python3以及pip3(安装python3后会自带)
    2.安装指令

    $ pip3 install --user jupyter
    

    在等待过程中会出现很多看起来不太舒服的提示(看文字颜色就觉得异常),异常提示如下

      The scripts jupyter, jupyter-migrate and jupyter-troubleshoot are installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The scripts jupyter-kernel, jupyter-kernelspec and jupyter-run are installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The script jsonschema is installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The script jupyter-trust is installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The script pygmentize is installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The script jupyter-nbconvert is installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The scripts iptest, iptest3, ipython and ipython3 are installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The scripts jupyter-bundlerextension, jupyter-nbextension, jupyter-notebook and jupyter-serverextension are installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
      The script jupyter-console is installed in '/Users/chenhao/Library/Python/3.6/bin' which is not on PATH.
      Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
    

    3.等待结束之后,我们测试一下,看能不能用

    $ jupyter notebook --help
    

    结果提示,果然不能用

    -bash: jupyter: command not found
    

    出现这个原因是因为环境变量未配置,所以我们配置一下环境变量
    3.我们进入环境变量的配置文件

    $ vim ~/.bash_profile
    

    然后在文件里添加以下配置

    export PATH=/Users/chenhao/Library/Python/3.6/bin:$PATH
    

    这里注意替换成你的jupyter的安装目录,也就是本文的第二个代码框里显示的路径(每个人不一样),然后保存退出。
    4.接下来使配置文件生效,并且再次测试一下

    $ source ~/.bash_profile  #使配置文件生效
    $ jupyter notebook --help  #测试,有一大堆东西跳出来说明成功了
    

    相关文章

      网友评论

          本文标题:mac OSX 10.14.4安装jupyter

          本文链接:https://www.haomeiwen.com/subject/flafwqtx.html