Blocking Cross Origin API request for /api/contents Creating Notebook Failed An error occurred while creating a new notebook.


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 成功


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM