1.安装 anaconda(自带安装jupyter)
2.配置 jupyter
jupyter notebook --generate-config
# 生成密码
from notebook.auth import passwd
passwd()
# 生成key,复制留存并修改到配置文件中去
vim ~/.jupyter/jupyter_notebook_config.py
# 修改配置文件中的内容,并将注释去掉
c.NotebookApp.ip='*' # 就是设置所有ip地址皆可访问
c.NotebookApp.password = u'sha:ce... # 复制的那个密文key 替换等号后面的内容,注意,有u'
c.NotebookApp.open_browser = False # 禁止自动打开浏览器
c.NotebookApp.port =8888 # 指定一个可用端口,也可以是其他闲置的端口
## The directory to use for notebooks and kernels.
#c.NotebookApp.notebook_dir = ''
3.将虚拟环境添加至核
参考 Jupyter Notebook运行指定的conda虚拟环境_TopFancy的博客-CSDN博客_jupyter使用虚拟环境
# base 环境
conda install nb_conda
# 虚拟环境
conda install ipykernel
# ---------------------以下无效-----------------------
jupyter kernelspec list
python -m ipykernel install --user --name=query_names
https://medium.com/analytics-vidhya/create-virtual-environment-using-conda-and-add-it-to-jupyter-notebook-d319a81dfd1
4.运行
jupyter notebook
本地浏览器输入:服务器ip:端口号
自行选择环境