2016-05-14 58 views
2

我正在关注的检索和进阶教程,一切都很好,直到train.py脚本 - 我得到下面的错误消息:IBM华生 - 检索和排名

Generating training data... 
Traceback (most recent call last): 
    File "./train.py", line 83, in <module> 
    process = subprocess.Popen(shlex.split(curl_cmd), stdout=subprocess.PIPE) 
    File "C:\Python27\lib\subprocess.py", line 710, in __init__ 
    errread, errwrite) 
    File "C:\Python27\lib\subprocess.py", line 958, in _execute_child 
    startupinfo) 
WindowsError: [Error 2] The system cannot find the file specified 

任何想法?

+0

是否有任何链接指向您正在讨论的内容,即教程或'train.py'?从错误消息中,您可能没有在路径上安装[**'cURL' **](https://curl.haxx.se/download.html)。 –

+0

在[本页](https://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/retrieve-rank/get_start.shtml)上说它需要一个Bluemix帐户,cURL和Python。它会告诉你安装哪个版本的cURL以及从哪里获取它。 –

+0

谢谢彼得。我创建了一个Bluemix帐户并按照教程。还安装了cURL和Python(第2版,根据需要运行train.py。只有当我运行train.py时出现了这个错误。 –

回答

1

@ peter-wood在评论中回答了这个问题。

在这种情况下,不友好的错误消息:

WindowsError: [Error 2] The system cannot find the file specified 

通过curl不可正对PATH引起的。 train.py预计curl命令可用并在PATH上。

+0

只是要注意,因为它让我绊倒了'直到我意识到我做了什么:它需要在环境调用cURL的路径中 - 所以如果您从可能不共享相同环境的某个/某处执行脚本作为命令行中的用户标识符,您可能需要采取措施确保执行环境的PATH在某处还有cURL。 –