2016-01-04 51 views
0

我試圖運行一個導入Numpy的Python代碼。然而,每次我試圖做到這一點,它顯示Python shell上sys.path的問題

Error importing numpy: you should not try to import numpy from its source directory; 
please exit the numpy source tree, and relaunch your python interpreter from there. 

然後我刪除了NumPy的目錄與

sys.path.remove(\...) 

,並重新啓動Python的外殼。現在它仍然顯示相同的錯誤消息,當我嘗試使用sys.path命令時,它打印

NameError: name 'sys' is not defined 

有人能幫助我嗎?

回答

0

NameError:名字「SYS」沒有定義

爲了解決這個問題,你需要「進口SYS」你所撥打的任何功能,與它之前。

0

我發現我只能寫import sys :)