2012-09-10 69 views
-1

我已經在本地機器(Windows 7)中安裝了pyton 2.7.3,並按照http://docs.python.org/tutorial/interpreter.html的說明操作,我嘗試使用cmd提示設置路徑。如何設置Python的路徑

集路徑=%路徑%; C:\ python27

但是,當我在命令行鍵入此錯誤顯示

Traceback (most recent call last): File"<stdin>",line 1, in <module> 
Nameerror:name 'python' is not defined 

我還試圖添加路徑手動

Start Menu > Control Panel > System & Security > System > Advanced System Settings/ 

Under System variables-path->edit and added this code ;C:\python27 

但仍然當我t ype python in command line我得到同樣的錯誤

我該怎麼辦?

+8

這聽起來像你鍵入「蟒蛇」的Python裏,而不是在系統命令行。描述你如何進入你輸入的命令行。 – BrenBarn

+0

@BrenBarn我是新來的蟒蛇;我在python命令行中輸入了代碼 – Eka

+1

如果您已經在Python命令行中,那麼設置路徑已經太遲了:您已經在運行Python。正如您鏈接到的文檔所述,您需要在DOS框中鍵入「設置路徑」*(例如,通過從開始菜單中選擇「命令提示符」) – BrenBarn

回答

2

您必須執行第二部分,在Python解釋器本身中執行python命令。