2015-04-17 30 views
1

我克隆figway GitHub的项目,以查询实体的属性猎户座的错误,但我得到一个错误在所有的Python脚本:获取所有figway Python脚本

File "GetEntity.py", line 37, in <module> 
    config = ConfigParser.RawConfigParser(allow_no_value=True) 
TypeError: __init__() got an unexpected keyword argument 'allow_no_value' 

我称它像是 - >蟒蛇GetEntity.py房

+0

你有配置文件的所有必填字段正确填写?它位于python-IDAS4文件夹中。 – LeandroGuillen

回答

1

一些提示,以调查发生了什么:

  • 您应该使用Python2.7来运行这些脚本。您能否让我知道您使用的是哪个版本和操作系统?
  • 上周我们更新了FIGWAY。如果你之前做过,你能否再次克隆它?
  • 你应该使用新的脚本在文件夹:/蟒蛇-IDAS4/ContextBroker

与以前的假设,你应该得到这样的事情(只要该实体不上ContextBroker当时存在正在):

[email protected] ~/github/fiware-figway/python-IDAS4/ContextBroker $ python GetEntity.py Room 
* Asking to http://130.206.80.40:1026/ngsi10/queryContext 
* Headers: {'Fiware-Service': 'OpenIoT', 'content-type': 'application/json', 'accept': 'application/json', 'X-Auth-Token': 'NULL'} 
* Sending PAYLOAD: 
{ 
    "entities": [ 
     { 
      "type": "", 
      "id": "Room", 
      "isPattern": "false" 
     } 
    ], 
    "attributes": [] 
} 

... 

* Status Code: 200 
* Response: 
{ 
    "errorCode" : { 
    "code" : "404", 
    "reasonPhrase" : "No context element found" 
    } 
} 
+0

嗨,谢谢你的回复。我在VIrtualBox上使用CentOS6.6,Python的版本是2.6.6。我在最后一个星期四克隆它,所以我认为是更新:) –

+0

我安装了Python的2.7版本,但现在一些导入不像导入请求。当我尝试点击安装请求它说它已经安装在/usr/lib/python2.6/site-packages ...任何sugestions? –

+0

看看[virtualenv](http://docs.python-guide.org/en/latest/dev/virtualenvs/)。这是一个非常有用的工具,可以让您的环境为每个项目分开。但一个快速解决方案是可能只是删除软件包并重新安装它。 –