Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Running notebooks with Python 3.8.3 causes Assertion errors

Đang mở
#519 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
jupyter-notebook, python
Lĩnh vực
devtools

Hướng nghiên cứu

Tái hiện circuits_advanced/1_advanced_circuits.ipynb được liên kết từ một kernel mới với Python 3.8.3, sau đó kiểm tra các vị trí trong traceback ở ipykernel/kernelbase.py và tornado/ioloop.py. So sánh với Python 3.8.2 hoặc 3.7.x, nơi notebook hoạt động; hoàn tất khi xác định được nguyên nhân tương thích và xác minh được fix hoặc thay đổi dependency tạo ra từ đó.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Since upgrading to the latest python release 3.8.3 on my system I have had issues running a notebook, specifically: https://github.com/Qiskit/qiskit-tutorials/blob/master/tutorials/circuits_advanced/1_advanced_circuits.ipynb Running that notebook when you run it from scratch on a fresh kernel it hangs on cell 8 and the jupyter notebook output logs multiple assertion errors:

[I 07:27:26.810 NotebookApp] Replaying 3 buffered messages
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 209, in wrapper
    yielded = next(result)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 543, in execute_request
    self.do_execute(
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 225, in wrapper
    runner = Runner(result, future, yielded)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 712, in __init__
    if self.handle_yield(first_yielded):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 789, in handle_yield
    self.io_loop.add_future(self.future, inner)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/ioloop.py", line 693, in add_future
    assert is_future(future)
AssertionError
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 209, in wrapper
    yielded = next(result)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 543, in execute_request
    self.do_execute(
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 225, in wrapper
    runner = Runner(result, future, yielded)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 712, in __init__
    if self.handle_yield(first_yielded):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 789, in handle_yield
    self.io_loop.add_future(self.future, inner)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/ioloop.py", line 693, in add_future
    assert is_future(future)
AssertionError
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 209, in wrapper
    yielded = next(result)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 543, in execute_request
    self.do_execute(
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 225, in wrapper
    runner = Runner(result, future, yielded)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 712, in __init__
    if self.handle_yield(first_yielded):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 789, in handle_yield
    self.io_loop.add_future(self.future, inner)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/ioloop.py", line 693, in add_future
    assert is_future(future)
AssertionError
[IPKernelApp] ERROR | Exception in message handler:
Traceback (most recent call last):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 268, in dispatch_shell
    yield gen.maybe_future(handler(stream, idents, msg))
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 735, in run
    value = future.result()
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 209, in wrapper
    yielded = next(result)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/ipykernel/kernelbase.py", line 543, in execute_request
    self.do_execute(
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 225, in wrapper
    runner = Runner(result, future, yielded)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 712, in __init__
    if self.handle_yield(first_yielded):
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/gen.py", line 789, in handle_yield
    self.io_loop.add_future(self.future, inner)
  File "/tmp/test-tutorials/lib/python3.8/site-packages/tornado/ioloop.py", line 693, in add_future
    assert is_future(future)
AssertionError

Downgrading python to 3.8.2 (or 3.7.x) fixes this. I've also confirmed it on other platforms (I run on linux, but mac users running 3.8.3 have had the same issue). I assume this is probably a bug in python or tornado, but I lack the domain expertise on the stack to be sure.

Ngôn ngữ chính
Python
Star
734
Fork
411
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
9

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của ipython/ipykernel

Tất cả issue của ipython/ipykernel

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.