Python exception: error: [Errno 10054] An existing connection was forcibly closed by the remote host

Python exception: error: [Errno 10054] An existing connection was forcibly closed by the remote host

我最近安装了 predictionio,用于在 vagrant box 上进行推荐。我对它很陌生。当我尝试 运行 其 python 示例文件 import_eventserver 时,我 运行 出现以下错误:

C:\HashiCorp\Vagrant\PredictionIO-Vagrant-0.8.2\MyRecommendation>python data/imp
ort_eventserver.py --access_key some_access_key
Namespace(access_key='some_access_key', file='./data/sample_movielens_data.txt', url='http://localhost:7070')

正在导入数据...

Traceback (most recent call last):
  File "data/import_eventserver.py", line 76, in <module>
    import_events(client, args.file)
  File "data/import_eventserver.py", line 45, in import_events
    target_entity_id=data[1]
  File "C:\Anaconda\lib\site-packages\predictionio-0.8.3-py2.7.egg\predictionio\
__init__.py", line 243, in create_event
    event_time).get_response()
  File "C:\Anaconda\lib\site-packages\predictionio-0.8.3-py2.7.egg\predictionio\
connection.py", line 113, in get_response
    self._response = self.rfunc(tmp_response)
  File "C:\Anaconda\lib\site-packages\predictionio-0.8.3-py2.7.egg\predictionio\
__init__.py", line 120, in _acreate_resp
    (response.error, response.request))
predictionio.NotCreatedError: Exception happened: [Errno 10054] An existing conn
ection was forcibly closed by the remote host for request POST /events.json?acce
ssKey=some_access_key {'eventTime': '2015-01-26T02:16:36.285+0000', 'entityType': 'user', 'targetEntityType': '
item', 'targetEntityId': '2', 'entityId': '0', 'event': 'buy'} /events.json?acce
ssKey=enFymhjuV3ighOz9R3u3FuiWSHNgWch241WbaTaXpdXyNJbKp5tYWO5IplkxUvR7?eventTime
=2015-01-26T02%3A16%3A36.285%2B0000&entityType=user&targetEntityType=item&target
EntityId=2&entityId=0&event=buy

关于如何知道这里出了什么问题有什么想法吗?任何帮助表示赞赏。

此错误与预测 IO 无关API。您收到的错误消息显示连接是从连接池中提取的,并且与服务器的连接已丢失。 错误是否可重现?你没有遇到网络问题吗?请检查组件之间的网络连接。 我刚刚尝试安装 w/ Python,在 Mac w/ Vagrant 上,一切对我来说都很好..

我认为需要以下命令来解决此错误。当您 运行 PIO 事件服务器或在 VM 内部署引擎时,您需要指定“--ip 0.0.0.0”以便从主机访问事件服务器和部署的引擎:

至运行 事件服务器: $ pio eventserver --ip 0.0.0.0

要部署引擎: $ pio deploy --ip 0.0.0.0