2015-04-17 64 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/)。這是一個非常有用的工具,可以讓您的環境爲每個項目分開。但一個快速解決方案是可能只是刪除軟件包並重新安裝它。 –