之前写了一篇: Anaconda、Jupyter的安装部署及使用问题总结
最近又用python比较多,升级了一下本机的anaconda版本,并使用jupyter lab来编写python脚本,本文记录一下升级、使用过程。
安装anaconda
- 下载安装包 Anaconda3-2023.03-1-Windows-x86_64.exe
- 在windows下双击安装(按提示一步步安装)
- 启动命令行,注意:必须使用
Anaconda Powershell Prompt
安装图形界面扩展
pip install jupyter_nbextensions_configurator
pip install jupyter_contrib_nbextensions
jupyter contrib nbextension install --user#注意: 开启,需要先安装
pip install autopep8
修改配置
- 生成配置
jupyter lab --generate-config# 默认的配置文件位置 ~/.jupyter/jupyter_lab_config.py
- 生成密码
jupyter lab password
- 修改配置文件
c = get_config() #noqa c.ServerApp.notebook_dir = 'D:\\python\\jupyter' c.ServerApp.ip = '0.0.0.0' c.ServerApp.allow_remote_access = False c.ServerApp.port = 8888 c.ServerApp.open_browser = False c.ExtensionApp.open_browser = False c.LabServerApp.open_browser = False c.ServerApp.allow_password_change = True c.ServerApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$L2cAHGGUyMEglJ2+LHjuOQ$3KTGUuq9pMpk/LUjPwnb7s9bCK/oa8lKxobNy2cFkZ0'
启动jupyter lab
jupyter lab --ip localhost --port 8080
jupyter lab
nohup jupyter lab &