0

我正在尝试对 fMRI 数据数据库进行元分析,通过 idle 使用neurosynth python 库。当我尝试运行一些最基本的功能时,我得到一个错误,而不是我自己的代码的错误,或者在神经合成器模块中,错误似乎是空闲本身的错误。

我卸载并重新安装了 python 2.7,重新安装了 neurosynth 及其依赖项,并遇到了同样的错误。我在下面粘贴了我的代码,然后是错误消息,它出现在 unix shell(而不是空闲 shell)中。

在使用 idle 和 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 shell 中的错误消息:

----------------------------------------
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!
----------------------------------------

提前致谢!

4

1 回答 1

0

Idle 用于在 shell 中进行交互式探索、在编辑器中进行编辑以及通过从编辑器中运行程序来测试程序。它不适用于一旦开发的程序的生产运行。如果有问题,应该将 Idle 部分与 running with Python 部分分开。因此,在 unix shell 中,运行python -m idlelib(例如)查看 Idle 是否正确启动。然后,在适当的目录中,运行python path-to-my-file.py. 哪个不起作用?

错误消息肯定很奇怪,因为它不仅仅是 python 回溯。另一方面,它不是从您的代码行开始的。我不知道为什么选择调用会被中断。

于 2014-09-15T07:38:42.443 回答