JupyterNoteBook-GO
如有錯誤,歡迎指出
錯誤
error: Cannot assign requested address
無法將當前地址分配給jupyter notebook
c.NotebookApp.ip='123.21.242.32'
c.NotebookApp.password = u'sha1:f012129dbf38:a3673a44bc5145ef336ea6940db21676fce9f85a'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.notebook_dir = '/root/home/Jupyter/'
c.InteractiveShellApp.matplotlib = 'inline'
解決:將c.NotebookApp.ip
改成0.0.0.0
c.NotebookApp.ip='0.0.0.0'
c.NotebookApp.password = u'sha1:f012129dbf38:a3673a44bc5145ef336ea6940db21676fce9f85a'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
c.NotebookApp.notebook_dir = '/root/home/Jupyter/'
c.InteractiveShellApp.matplotlib = 'inline'
Install-Go
golang源碼
解壓安裝包
wget https://golang.org/dl/
獲取軟件包
tar -C /usr/local go*
將壓縮包解壓至/usr/local
,此路徑為官方推薦
export PATH=/usr/local/go/bin:$PATH
配置命令環境
Install gophernotes
gophernotes
是go
內核,jupyter notebook
需要安裝其才能使用go來啟用交互式編程
官方教程
Question1:無法尋找命令
error: command not found: gophernotes
如果輸入gophernotes
提示沒有此命令,即可以按以下解決
find / -name 'gophernotes'
尋找系統gophernotes
命令
例如返回路徑/root/go/bin:$PATH
export PATH=/root/go/bin:$PATH
正常即可獲取響應2019/02/25 15:43:04 Need a command line argument specifying the connection file.
Question2:內存不足,溢出
error: fatal error: runtime: out of memory
內存過小,造成溢出。
解決方案:建立swap分區
圖片摘自參考資料2
Question3:jupyter內核錯誤,提示沒有gophernotes
文件或文件夾
修改kernels
中gophernotes
的kernel.json
中argv
的參數
# 原來的
{
"argv": [
"gophernotes",
"{connection_file}"
],
"display_name": "Go",
"language": "go",
"name": "go"
}
# 現在的,將命令變成絕對路徑
{
"argv": [
"/root/go/bin/gophernotes",
"{connection_file}"
],
"display_name": "Go",
"language": "go",
"name": "go"
}
重啟jupyter-notebook
即可
參考資料
1.gophernotes的github教程
2.如何建立swap分區
3.WillZhuang的博客之內存溢出解決
4.缺少libzmq
的問題