Mac Studio配置Jupyter

MAC开荒

最新安装的Anaconda已自动安装Jupyter Lab和 Jupyter Notebook,需要额外设置远程访问,

  1. SHELL输入jupyter notebook --generate-config生成配置文件;

  2. SHELL进入Python,from notebook.auth import passwd passwd;

  3. 修改文件./jupyter/jupyter_notebook_config.py,配置c.NotebookApp.ip='*' ' c.ServerApp.password = u'argon2xxxxxxxxxx',配置c.ServerApp.port为8888,配置c.ServerApp.open_browser = False

Jupyter设置虚拟环境切换,

  1. 安装ipykernel,分别在base和虚拟环境;

  2. 切换到虚拟环境conda activate env,手动添加kernel到Jupyterpython -m ipykernel install --user --name HarvardU --display-name "HarvardU";

  3. 重启Kernel生效。

Jupyter更改默认工作目录,修改文件./jupyter/jupyter_notebook_config.py,修改c.ServerApp.notebook_dir为工作目录。

Jupyter设置静默后台运行,SHELL输入nohup jupyter lab > /dev/null 2>&1 &,意为将日志输出到/dev/null文件,此文件为空,即不输出日志信息,2为标准错误输出,1为标准输出。

关闭Jupyter后台运行,可利用ps -ef | grep jupyter查找jupyter相关进程,利用kill -9 pid关闭进程。如未曾关闭SHELL,ps -a即可查看进程pid。

参考链接:
https://service.oray.com/question/14465.html
https://blog.csdn.net/LoseInVain/article/details/101875110
https://zhuanlan.zhihu.com/p/50456606
https://www.cnblogs.com/jasondan/p/3499175.html
https://morooi.com/2019/jupyter/

本文链接:

https://ma.ge/archives/648.html