当前位置:   article > 正文

MacBook使用pip安装JupyterLab_mac系统pip3 install jupyterlab defaulting to user in

mac系统pip3 install jupyterlab defaulting to user installation because norma

1、pip install jupyterlab或者pip3 install jupyterlab
2、安装完毕后,输入jupyter-lab,但是报错了!

-bash: jupyter-lab: command not found
  • 1

别慌,先找安装的文件在哪儿!使用下面的语句查找安装的地方

mdfind -name jupyter
  • 1

我的结果为(删除部分,保留/bin部分,因为这里存的是命令)

/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-console
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-qtconsole
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-serverextension
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-notebook
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-nbextension
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-bundlerextension
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-nbconvert
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-trust
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-run
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-kernelspec
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-kernel
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-troubleshoot
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter-migrate
/Library/Frameworks/Python.framework/Versions/3.7/bin/jupyter
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14

可以看到上面的结果,文件路径在/Library/Frameworks/Python.framework/Versions/3.7/bin里面,于是打开上诉文件件,找到jupyter-lab,双击运行,会发现,哎,出来了。
在这里插入图片描述
在这里插入图片描述
3、可以看出找不到命令还需要配置环境变量,于是vi ~/.bash_profile

1、JUPYTER=/Library/Frameworks/Python.framework/Versions/3.7
2、PATH=原来的路径:$JUPYTER/bin
3、export JUPYTER
4、export PATH
  • 1
  • 2
  • 3
  • 4

最后,source ./.bash_profile,使刚才的文件生效,echo $PATH查看是否有新添加进去的路径。
4、jupyter-lab,就ok啦!

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/297771
推荐阅读
相关标签
  

闽ICP备14008679号