需要讀取外網服務器時,需要走代理,本機代理走的是1080端口,可以將jupyter的代理設置到該端口上。
方法1:臨時修改
在終端進行設置,再在該終端上啓動jupyter,起來的notebook即可走代理。
set HTTP_PROXY=http://127.0.0.1:1080
set HTTPS_PROXY=http://127.0.0.1:1080
更通用的方法
set HTTP_PROXY=http://<user>:<password>@<proxy server>:<proxy port>
set HTTPS_PROXY=http://<user>:<password>@<proxy server>:<proxy port>
終端關閉或者重啓,代理設置失效
方法2:在配置文件中修改
配置文件在username/.jupyter文件中(windows下)
如果沒有要先生成:
jupyter notebook --generate-config
在該文件中添加上面的配置即可