第一步:安装Jupyter Notebook
pip install jupyter第二步:进入你的 Virtualenv里 (我是的venv3)
source venv3/bin/activite第三步:使用清华镜像安装 IPykernel,比较快
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple ipykernel第四步:将你的 Virtualenv 加入IPykernel里
python -m ipykernel install --user --name=venv3第五步:打开Jupyter
jupyter notebook[W 00:19:00.741 NotebookApp] No web browser found: could not locate runnable browser. 处理方式:
ipython from IPython.lib import passwd passwd() #得到加密后的hash exit jupyter notebook --generate-config vim ~/.jupyter/jupyter_notebook_config.py c.NotebookApp.ip = '*' c.NotebookApp.allow_root = True c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 c.NotebookApp.password = u'sha1:...' #输入上面加密后得到的密文Refusing to serve hidden directory, via 404 Error 如果成功在浏览器连接上服务器,但是登录输入密码后出现了404 You are requesting a page that does not exist!: 处理方式:在配置文件里面加上ipython文件的的保存路径就可以了(最后一行)
vim ~/.jupyter/jupyter_notebook_config.py c.NotebookApp.ip = '*' c.NotebookApp.allow_root = True c.NotebookApp.open_browser = False c.NotebookApp.port = 8888 c.NotebookApp.password = u'sha1:...' #输入上面加密后得到的密文 c.NotebookApp.notebook_dir = '/path/to/your/hidden/directory/'在本地终端中输入ssh username@address_of_remote -L127.0.0.1:1234:127.0.0.1:8888 此处的8888是指远程服务器jupyter登录的端口 便可以在localhost:1234直接访问远程的jupyter了。
在配置文件中加这样一行:
c.NotebookApp.allow_remote_access = True