2014-06-24 95 views
0

我想通過空閒使用neurosynth python library對fMRI數據的數據庫運行元分析。當我嘗試運行一些最基本的功能時,我得到一個錯誤,而不是錯誤我自己的代碼,或在neurosynth模塊中,錯誤似乎是空閒本身的錯誤。空閒異常(python 2.7) - 空閒時可能出現的錯誤?

我卸載並重新安裝了python 2.7,重新安裝了neurosynth及其依賴項,並且遇到了同樣的錯誤。我在下面粘貼了我的代碼,然後是錯誤消息,它出現在unix shell中(不在空閒的shell中)。

有沒有人在使用閒置和Python 2.7之前遇到這個錯誤?

腳本:

from neurosynth.base.dataset import Dataset 
from neurosynth.analysis import meta, decode, network 
import neurosynth 

neurosynth.set_logging_level('info') 

dataset = Dataset('data/database.txt') 
dataset.add_features('data/features.txt') 
dataset.save('dataset.pkl') 

print 'done' 

其中出現在UNIX外殼的錯誤消息:

---------------------------------------- 
Unhandled server exception! 
Thread: SockThread 
Client Address: ('127.0.0.1', 46779) 
Request: <socket._socketobject object at 0xcb8d7c0> 
Traceback (most recent call last): 
    File "/usr/global/python/2.7.3/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock 
    self.process_request(request, client_address) 
    File "/usr/global/python/2.7.3/lib/python2.7/SocketServer.py", line 310, in process_request 
    self.finish_request(request, client_address) 
    File "/usr/global/python/2.7.3/lib/python2.7/SocketServer.py", line 323, in finish_request 
    self.RequestHandlerClass(request, client_address, self) 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/rpc.py", line 503, in __init__ 
    SocketServer.BaseRequestHandler.__init__(self, sock, addr, svr) 
    File "/usr/global/python/2.7.3/lib/python2.7/SocketServer.py", line 638, in __init__ 
    self.handle() 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/run.py", line 265, in handle 
    rpc.RPCHandler.getresponse(self, myseq=None, wait=0.05) 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/rpc.py", line 280, in getresponse 
    response = self._getresponse(myseq, wait) 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/rpc.py", line 300, in _getresponse 
    response = self.pollresponse(myseq, wait) 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/rpc.py", line 424, in pollresponse 
    message = self.pollmessage(wait) 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/rpc.py", line 376, in pollmessage 
    packet = self.pollpacket(wait) 
    File "/usr/global/python/2.7.3/lib/python2.7/idlelib/rpc.py", line 347, in pollpacket 
    r, w, x = select.select([self.sock.fileno()], [], [], wait) 
error: (4, 'Interrupted system call') 

*** Unrecoverable, server exiting! 
---------------------------------------- 

提前感謝!

+0

從unix shell運行腳本時顯示錯誤嗎? – user2963623

回答

0

空閒用於shell中的交互式探索,用於在編輯器中進行編輯以及通過從編輯器運行它們來測試程序。它並不意味着一旦開發出來的程序的生產運行。如果出現問題,應該用Python部分將運行中的空閒部分分開。因此,在UNIX shell中,運行python -m idlelib(例如)以查看空閒是否正確啓動。然後,在適當的目錄中運行python path-to-my-file.py。哪個不行?

錯誤消息絕對是奇怪的,因爲它不僅僅是python回溯。另一方面,它不是以你的代碼行開始的。我不知道爲什麼選擇呼叫會中斷。