我没有安装anaconda,直接使用pip安装jupyter
在终端直接输入jupyter notebook会提示jupyter command not found
这是因为jupyter没有添加到环境变量中
解决方法:
- 打开.bash_profile: open -e .bash_profile
- 添加环境变量:jupyter-notebook的安装路径: export PATH=/usr/local/Cellar/python@3.9/3.9.2_1/Frameworks/Python.framework/Versions/3.9/bin/:$PATH
我应该是用brew安装的,所以是这个路径,最开始我是在/user/[用户名]这个目录下的bin文件夹找到的,jupyter-notebook就在里面。路径可以把文件夹拖到终端快速获得
不同安装方法的安装路径看这里
这篇文章有提到mac新系统默认终端是zsh不再是bash,默认启动的文件是.zshrc不是.bash_profile。
设置默认路径输入jupyter notebook --generate-config,会在/user/[用户名]/.jupyter下生成配置文件jupyter_notebook_config.py
.jupyter是隐藏文件夹,shift+command+>可以显示
在配置文件搜索c.NotebookApp.notebook_dir,前面去掉#,后面加路径



