2017-03-07 1181 views
0

我爲Python安裝了jupyter包,但是當我嘗試使用它時,出現SyntaxError:invalid syntax。在Python上使用Jupyter時出現SyntaxError

我試圖刪除Python並重新安裝它,但我得到了相同的結果。

我使用Windows 10和Python 2.7.13 如果需要更多信息,請詢問。

Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:42:59) [MSC v.1500 32 bit (Intel)] on win32 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import jupyter 
>>> jupyter notebook 
    File "<stdin>", line 1 
    jupyter notebook 
       ^
SyntaxError: invalid syntax 
+3

你應該嘗試直接從終端調用'jupyter notebook',而不是從python內部調用 – dangom

+1

[有關啓動jupyter的更多信息](https://jupyter.readthedocs.io/en/latest/running.html#starting-the - 筆記本,服務器) – Orange

回答

1

要開始jupyter只需輸入(像你一樣):

jupyter notebook 

在你選擇的任何終端

例如,在Windows中,進入命令提示符,它看起來像這樣:

cmd

(因爲你是在Windows 10只搜索CMD與開始菜單,然後按回車)

...並鍵入,您不使用IDLE(Python)或任何其他IDE來啓動它。


如果你不想去了CMD要打開jupyter筆記本每次,只需要創建一個快捷方式,並在此窗口中出現:

Window

。 ..你必須鍵入jupyter notebook然後下一步,然後它會要求你給這個快捷鍵一個名字,隨便你打電話給它並完成。現在你可以雙擊一個圖標,你的瀏覽器就會自動彈出。

相關問題