anacoda安裝的jupyter,使用nginx進行了轉發,遠程訪問可以進去,但是創建文件和創建目錄都會報錯
瀏覽器頁面報錯:
第一次使用jupyter創建python時錯誤:Creating Notebook Failed An error occurred while creating a new notebook.
后台日志報錯:
[W 11:06:56.582 NotebookApp] Blocking Cross Origin API request for /api/contents. Origin: http://xx/xx/xx/xx:123546, Host: 172.20.25.164
[W 11:06:56.597 NotebookApp] 404 POST /api/contents (127.0.0.1) 16.26ms referer=http://xx/xx/xx/xx:8088/tree?
現狀:
能訪問到,但是無法創建
嘗試:
1.授權anacoda下的jupter文件為777權限,工作目錄為777權限,不能解決問題
2.重裝anacoda,不能解決問題
3.pip卸載重裝jupyter,不能解決問題
解決
打開jupyter_notebook_config.py
文件
找到c.NotebookApp.allow_origin = ' '
將' '改為‘*’
保存退出 重新啟動jupyter 成功