2017-03-19 177 views
-1

當我運行python程序時出現這個錯誤,我嘗試了幾乎所有的東西,但沒有任何工作,這是我的[source代碼]OSError:[Errno 2]沒有這樣的文件或目錄subprocess.py「,行1024,在_execute_child raise child_exception

def run_p300speller(directory): 
    print("Starting benchmark, this will take some minutes...") 
    subprocess.call(["./P300Speller", directory]) 

錯誤https://github.com/OpenANN/OpenANN/blob/master/benchmarks/p300speller/benchmark.py)。有什麼建議? File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 168, in call return Popen(*popenargs, **kwargs).wait() File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory

+1

顯示您用於生成該錯誤的代碼。 –

+0

要麼./P300Speller或目錄不存在 – abccd

+0

我認爲該目錄應該用引號'「」'給出?例如'python benchmark.py「/ Users/myAccount/Desktop/P300Speller」download run' – wahtdbogh

回答

0

確保'/P300Speller'存在。

subprocess.call(["./P300Speller", directory]) 
+0

但即使我在目錄P300Speller文件中創建它也沒有改變任何東西。 – wahtdbogh

相關問題