2017-01-16 10 views
0

Код ниже воспроизводит ошибку на моей машине:Jupyer Notebook дает ошибку Cython при попытке использовать IPython.display.Audio

from IPython.display import Audio 
Audio(filename='sample.mp3') 

Ноутбук не может выполнить или показать сообщение, в журнале терминала выходного является

ERROR:tornado.general:Uncaught exception, closing connection. 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 407, in _run_callback 
    callback(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper 
    return fn(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 107, in _handle_event 
    event_f() 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 199, in <lambda> 
    self.schedule(lambda : self._really_send(*args, **kwargs)) 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 207, in _really_send 
    self.socket.send_multipart(msg, *args, **kwargs) 
    File "/usr/lib/python2.7/dist-packages/zmq/sugar/socket.py", line 236, in send_multipart 
    self.send(msg, SNDMORE|flags, copy=copy, track=track) 
    File "socket.pyx", line 565, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:5263) 
    File "socket.pyx", line 619, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:5111) 
    File "message.pyx", line 183, in zmq.backend.cython.message.Frame.__cinit__ (zmq/backend/cython/message.c:1682) 
OverflowError: can't convert negative value to size_t 
ERROR:tornado.general:Uncaught exception, closing connection. 
Traceback (most recent call last): 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 433, in _handle_events 
    self._handle_recv() 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 465, in _handle_recv 
    self._run_callback(callback, msg) 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 407, in _run_callback 
    callback(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper 
    return fn(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 107, in _handle_event 
    event_f() 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 199, in <lambda> 
    self.schedule(lambda : self._really_send(*args, **kwargs)) 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 207, in _really_send 
    self.socket.send_multipart(msg, *args, **kwargs) 
    File "/usr/lib/python2.7/dist-packages/zmq/sugar/socket.py", line 236, in send_multipart 
    self.send(msg, SNDMORE|flags, copy=copy, track=track) 
    File "socket.pyx", line 565, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:5263) 
    File "socket.pyx", line 619, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:5111) 
    File "message.pyx", line 183, in zmq.backend.cython.message.Frame.__cinit__ (zmq/backend/cython/message.c:1682) 
OverflowError: can't convert negative value to size_t 
ERROR:tornado.application:Exception in callback None 
Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/dist-packages/tornado/ioloop.py", line 887, in start 
    handler_func(fd_obj, events) 
    File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper 
    return fn(*args, **kwargs) 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 433, in _handle_events 
    self._handle_recv() 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 465, in _handle_recv 
    self._run_callback(callback, msg) 
    File "/usr/lib/python2.7/dist-packages/zmq/eventloop/zmqstream.py", line 407, in _run_callback 
    callback(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/tornado/stack_context.py", line 275, in null_wrapper 
    return fn(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 107, in _handle_event 
    event_f() 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 199, in <lambda> 
    self.schedule(lambda : self._really_send(*args, **kwargs)) 
    File "/usr/local/lib/python2.7/dist-packages/ipykernel/iostream.py", line 207, in _really_send 
    self.socket.send_multipart(msg, *args, **kwargs) 
    File "/usr/lib/python2.7/dist-packages/zmq/sugar/socket.py", line 236, in send_multipart 
    self.send(msg, SNDMORE|flags, copy=copy, track=track) 
    File "socket.pyx", line 565, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:5263) 
    File "socket.pyx", line 619, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:5111) 
    File "message.pyx", line 183, in zmq.backend.cython.message.Frame.__cinit__ (zmq/backend/cython/message.c:1682) 
OverflowError: can't convert negative value to size_t 

ошибка не является специфичной для аудиофайла, используя другой звуковой файл или положить в Numpy массива дает ту же самую ошибку.

Что мне не хватает?

ответ

0

Было высказано предположение, что такое же сообщение об ошибке генерируется из-за устаревшей версии pyzmq (https://github.com/CellProfiler/CellProfiler/issues/1676). Установка последней версии pyzmq через pip устранила эту проблему в моей системе. Надеюсь это поможет.