linux服务器安装anaconda:
1.1 下载安装脚本:
wget https://repo.anaconda.com/archive/Anaconda3-5.2.0-Linux-x86_64.sh
1.2 运行安装向导:
bash Anaconda3-5.2.0-Linux-x86_64.sh
1.3 确认是否安装成功:
conda --version
linux服务器配置juypter,然后远程使用jupyter:
1. 进入环境ipython, 在ipython环境下输入:
from notebook.auth import passwd
passwd()
# 输入方便你记的密码,连续输;两次..输完密码后,会输出一个字符串,形如: ’sha1:9e7a5c5e0a29:8cbdvsv2344d141c92beab1c5bc6e9avsdvdsvsv’
# 将其保存下来, 完成以上操作后,通过exit()推出ipython环境
2. 进入到安装目录:cd /home/lhc/anaconda3/etc/jupyter, 执行 :
jupyter notebook --generate-config
#(命令会产生文件:home/lhc/.jupyter/jupyter_notebook_config.py)
3. 编辑配置文件,编辑此文件,写入
c.NotebookApp.ip = '*' # 允许访问此服务器的 IP,星号表示任意 IP
c.NotebookApp.password = u'sha1:xxx:xxx' # 之前生成的密码 hash 字串
c.NotebookApp.open_browser = False # 运行时不打开本机浏览器
c.NotebookApp.port = 12035 # 使用的端口,随意设置
c.NotebookApp.enable_mathjax = True # 启用 MathJax
4. 启动服务
Jupyter notebook
sudo start jupyter # 启动 jupyter
sudo stop/restart jupyter # 停止/重启 jupyter
sudo status jupyter # 查看 jupyter 的状态
windows客户端设置
如果你是linux本地机,那么就可以通过ssh访问远程服务器,在命令行中启动jupyter notebook,
输入localhost:8000(这里的端口号与你设置的有关),但如果在windows下:
-
通过ssh或者xshell等工具访问远程服务器,在你的会话中进行设置,比如xshell中,选择属性-ssh-隧道,点击添加
-
-
侦听端口填写刚才的8000,目标端口默认是8888;
-
设置完成后,在ssh或者xshell的命令行中输入
jupyter notebook
-
此刻,在windows本地中输入localhost:8000就可以访问远程服务器上的jupyter了;
会出现设置密码的界面,如果不记得密码,可直接复制命令行界面中输出的token后面的字符串(红
划掉的部分
...]