Pythonidle 是否有可能存在 bug?

问题描述 投票:0回答:1

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

我卸载并重新安装了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!
----------------------------------------
python database python-2.7 sockets python-idle
1个回答
0
投票

Idle 用于在 shell 中进行交互式探索、在编辑器中进行编辑以及通过从编辑器运行程序来测试程序。它不适用于程序开发后的生产运行。如果出现问题,应该将 Idle 部分与 running with Python 部分分开。因此,在 unix shell 中,运行

python -m idlelib
(例如)来查看 Idle 是否正确启动。然后,在适当的目录中,运行
python path-to-my-file.py
。哪个不起作用?

错误消息肯定很奇怪,因为它不仅仅是 python 回溯。另一方面,它并不是以一行代码开头。我不知道为什么 select 调用会被中断。

© www.soinside.com 2019 - 2024. All rights reserved.