開發與維運

Vscode配置jupyter

Vscode配置jupyter

環境

  • Win10
  • Vscode 1.40.2
  • Python 3.8
  • pip 19.3.1
  • jupyter 6.0.2效果圖

install Python&jupyter

windows安裝python3.8
windows通過pip安裝jupyter
pip install jupyter

jupyter notebook 啟動報錯

報錯asyncioevents.py", line 501, in add_reader
   raise NotImplementedError,通過修改對應報錯路徑下文件解決
報錯 pywinpty 無法安裝,可通過手動安裝解決 

jupyter notebook list查看啟動密碼

Vscode安裝Python
image.png

Vscode安裝jupyter插件
image.png

quick start

  • 在vscode中創建下列python文件
#%%
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
x = np.linspace(0, 20, 100)
plt.plot(x, np.sin(x))
plt.show()
  • Click on the code lens Run Cell

image.png

官方示例

官方教程

 (Ctrl+Shift+P) 
Python: Create Blank New Jupyter Notebook 創建notebook編輯面板
Python:Select interpreter   選擇虛擬環境

Leave a Reply

Your email address will not be published. Required fields are marked *