若是缺乏依賴,缺啥裝啥javascript
jupyter notebook
若是運行成功,結果以下:java
[I 09:03:15.177 NotebookApp] JupyterLab beta preview extension loaded from /home/winddy/anaconda3/lib/python3.6/site-packages/jupyterlab [I 09:03:15.177 NotebookApp] JupyterLab application directory is /home/winddy/anaconda3/share/jupyter/lab [I 09:03:15.182 NotebookApp] Serving notebooks from local directory: /home/winddy [I 09:03:15.182 NotebookApp] 0 active kernels [I 09:03:15.182 NotebookApp] The Jupyter Notebook is running at: [I 09:03:15.182 NotebookApp] http://localhost:8888/?token=c19f036f3beb2bce5112ca9c2f4565e738175a9853302e44 [I 09:03:15.182 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 09:03:15.183 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=c19f036f3beb2bce5112ca9c2f4565e738175a9853302e44&token=c19f036f3beb2bce5112ca9c2f4565e738175a9853302e44 [I 09:03:15.693 NotebookApp] Accepting one-time-token-authenticated connection from ::1 Created new window in existing browser session. [W 09:03:16.282 NotebookApp] Error stat-ing /home/winddy/.gvfs: [Errno 13] Permission denied: '/home/winddy/.gvfs'
從上面能夠知道,Jupyter notebook 生成的服務器地址爲:http://localhost:8888/?token=c19f036f3beb2bce5112ca9c2f4565e738175a9853302e44 其中端口號爲8888,注意,若是你打開多個Jupyter notebook , 那麼每個服務的端口號是不同的python
這裏巨坑,pycharm 的官網都JB坑bash
在pycharm 新建一個後綴名爲:.ipynb 的文件,若是你的pycharm沒有解析改後綴名的插件,按照提示默認裝好插件就能夠服務器
在第一個cell中輸入: %matplotlib inlinesession
點擊運行按鈕,這時,用戶會由於環境不一樣會報各類錯,這個放在後面講app
點擊後pycharm會彈出一個會話框測試
注意,你能夠在這個會話框中填入服務器地址,可是,咱們這裏只想在本地編輯,因此直接點取消, 而後出現
ui
他會說不能鏈接到Jupyter notebook, 咱們無論這個提示,由於咱們只想在本地編輯,因此直接點擊 run Jupyter notebook
!!!!!!到這裏,若是沒出現錯誤的話,pycharm會直接幫你啓動服務並運行你指定的代碼
this
(若是,你看到這個界面,那說明就OJBK了)
填寫測試代碼,逐個運行
sh pycharm.sh
, 若是你是用命令: sudo sh pycharm.sh
運行pycharm,那麼你就會以管理員的身份運行pycharm (注意,重啓終端,若是你的終端剛被執行了sudo, 那麼此時執行 sh pycharm.sh 也是管理員身份)[I 09:02:18.636 NotebookApp] JupyterLab beta preview extension loaded from /home/winddy/anaconda3/lib/python3.6/site-packages/jupyterlab [I 09:02:18.636 NotebookApp] JupyterLab application directory is /home/winddy/anaconda3/share/jupyter/lab [C 09:02:18.641 NotebookApp] Running as root is not recommended. Use --allow-root to bypass.
sudo chmod 777 jupyter/
Permission denied: '/home/winddy/.local/share/jupyter/kernels'
NotebookApp] '_xsrf' argument missing from POST