jupyter / jupyter_client

Jupyter protocol client APIs
https://jupyter-client.readthedocs.io
BSD 3-Clause "New" or "Revised" License
386 stars 285 forks source link

7.3.0 jupyter lab dies with "IndexError: pop from an empty deque" #780

Open ruomad opened 2 years ago

ruomad commented 2 years ago

Hello, After upgrading to 7.3.0, running a notebook in jupyterlab aborts with IndexError: pop from an empty deque Downgrading to 7.2.2 fixes the problem. Has anyone seen this ?

blink1073 commented 2 years ago

Hi @ruomad, can you please describe your environment? The output of jupyter troubleshoot would be helpful (you may want to sanitize paths or other sensitive information).

I just ran a fresh conda environment on my computer and it is working fine.

jupyter troubleshoot
$PATH: /tmp/conda_envs/bc2fdad912ee02a6c613fd97/bin /Users/steve.silvester/miniconda/condabin /Users/steve.silvester/bin /usr/local/bin /usr/local/sbin /Users/steve.silvester/.local/bin /Applications/Sublime Text.app/Contents/SharedSupport/bin /usr/local/bin /usr/bin /bin /usr/sbin /sbin sys.path: /private/tmp/conda_envs/bc2fdad912ee02a6c613fd97/bin /tmp/conda_envs/bc2fdad912ee02a6c613fd97/lib/python310.zip /tmp/conda_envs/bc2fdad912ee02a6c613fd97/lib/python3.10 /tmp/conda_envs/bc2fdad912ee02a6c613fd97/lib/python3.10/lib-dynload /tmp/conda_envs/bc2fdad912ee02a6c613fd97/lib/python3.10/site-packages sys.executable: /tmp/conda_envs/bc2fdad912ee02a6c613fd97/bin/python sys.version: 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:45:10) [Clang 12.0.1 ] platform.platform(): macOS-12.3.1-x86_64-i386-64bit which -a jupyter: /tmp/conda_envs/bc2fdad912ee02a6c613fd97/bin/jupyter pip list: Package Version ----------------------------- ----------- anyio 3.5.0 appnope 0.1.3 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 asttokens 2.0.5 attrs 21.4.0 Babel 2.10.1 backcall 0.2.0 backports.functools-lru-cache 1.6.4 beautifulsoup4 4.11.1 bleach 5.0.0 certifi 2021.10.8 cffi 1.15.0 charset-normalizer 2.0.12 debugpy 1.6.0 decorator 5.1.1 defusedxml 0.7.1 entrypoints 0.4 executing 0.8.3 fastjsonschema 2.15.3 idna 3.3 ipdb 0.13.9 ipykernel 6.13.0 ipython 8.2.0 ipython-genutils 0.2.0 jedi 0.18.1 Jinja2 3.1.1 json5 0.9.6 jsonschema 4.4.0 jupyter-client 7.3.0 jupyter-core 4.9.2 jupyter-server 1.17.0 jupyterlab 3.3.4 jupyterlab-pygments 0.2.2 jupyterlab-server 2.13.0 MarkupSafe 2.1.1 matplotlib-inline 0.1.3 mistune 0.8.4 nbclassic 0.3.7 nbclient 0.6.0 nbconvert 6.5.0 nbformat 5.3.0 nest-asyncio 1.5.5 notebook 6.4.11 notebook-shim 0.1.0 packaging 21.3 pandocfilters 1.5.0 parso 0.8.3 pexpect 4.8.0 pickleshare 0.7.5 pip 22.0.4 prometheus-client 0.14.1 prompt-toolkit 3.0.29 psutil 5.9.0 ptyprocess 0.7.0 pure-eval 0.2.2 pycparser 2.21 Pygments 2.12.0 pyparsing 3.0.8 pyrsistent 0.18.1 python-dateutil 2.8.2 pytz 2022.1 pyzmq 22.3.0 requests 2.27.1 Send2Trash 1.8.0 setuptools 62.1.0 six 1.16.0 sniffio 1.2.0 soupsieve 2.3.2.post1 stack-data 0.2.0 terminado 0.13.3 tinycss2 1.1.1 tornado 6.1 traitlets 5.1.1 urllib3 1.26.9 wcwidth 0.2.5 webencodings 0.5.1 websocket-client 1.3.2 wheel 0.37.1 conda list: # packages in environment at /tmp/conda_envs/bc2fdad912ee02a6c613fd97: # # Name Version Build Channel anyio 3.5.0 pypi_0 pypi appnope 0.1.3 pyhd8ed1ab_0 conda-forge argon2-cffi 21.3.0 pypi_0 pypi argon2-cffi-bindings 21.2.0 pypi_0 pypi asttokens 2.0.5 pyhd8ed1ab_0 conda-forge attrs 21.4.0 pypi_0 pypi babel 2.10.1 pypi_0 pypi backcall 0.2.0 pyh9f0ad1d_0 conda-forge backports 1.0 py_2 conda-forge backports.functools_lru_cache 1.6.4 pyhd8ed1ab_0 conda-forge beautifulsoup4 4.11.1 pypi_0 pypi bleach 5.0.0 pypi_0 pypi bzip2 1.0.8 h0d85af4_4 conda-forge ca-certificates 2021.10.8 h033912b_0 conda-forge certifi 2021.10.8 pypi_0 pypi cffi 1.15.0 pypi_0 pypi charset-normalizer 2.0.12 pypi_0 pypi debugpy 1.6.0 py310h9d931ec_0 conda-forge decorator 5.1.1 pyhd8ed1ab_0 conda-forge defusedxml 0.7.1 pypi_0 pypi entrypoints 0.4 pyhd8ed1ab_0 conda-forge executing 0.8.3 pyhd8ed1ab_0 conda-forge fastjsonschema 2.15.3 pypi_0 pypi idna 3.3 pypi_0 pypi ipdb 0.13.9 pyhd8ed1ab_0 conda-forge ipykernel 6.13.0 py310ha188af9_0 conda-forge ipython 8.2.0 py310h2ec42d9_0 conda-forge ipython-genutils 0.2.0 pypi_0 pypi jedi 0.18.1 py310h2ec42d9_1 conda-forge jinja2 3.1.1 pypi_0 pypi json5 0.9.6 pypi_0 pypi jsonschema 4.4.0 pypi_0 pypi jupyter-server 1.17.0 pypi_0 pypi jupyter_client 7.3.0 pyhd8ed1ab_0 conda-forge jupyter_core 4.9.2 py310h2ec42d9_0 conda-forge jupyterlab 3.3.4 pypi_0 pypi jupyterlab-pygments 0.2.2 pypi_0 pypi jupyterlab-server 2.13.0 pypi_0 pypi libcxx 13.0.1 hc203e6f_0 conda-forge libffi 3.4.2 h0d85af4_5 conda-forge libsodium 1.0.18 hbcb3906_1 conda-forge libzlib 1.2.11 h6c3fc93_1014 conda-forge markupsafe 2.1.1 pypi_0 pypi matplotlib-inline 0.1.3 pyhd8ed1ab_0 conda-forge mistune 0.8.4 pypi_0 pypi nbclassic 0.3.7 pypi_0 pypi nbclient 0.6.0 pypi_0 pypi nbconvert 6.5.0 pypi_0 pypi nbformat 5.3.0 pypi_0 pypi ncurses 6.3 h96cf925_1 conda-forge nest-asyncio 1.5.5 pyhd8ed1ab_0 conda-forge notebook 6.4.11 pypi_0 pypi notebook-shim 0.1.0 pypi_0 pypi openssl 3.0.2 h6c3fc93_1 conda-forge packaging 21.3 pyhd8ed1ab_0 conda-forge pandocfilters 1.5.0 pypi_0 pypi parso 0.8.3 pyhd8ed1ab_0 conda-forge pexpect 4.8.0 pyh9f0ad1d_2 conda-forge pickleshare 0.7.5 py_1003 conda-forge pip 22.0.4 pyhd8ed1ab_0 conda-forge prometheus-client 0.14.1 pypi_0 pypi prompt-toolkit 3.0.29 pyha770c72_0 conda-forge psutil 5.9.0 py310h1961e1f_1 conda-forge ptyprocess 0.7.0 pyhd3deb0d_0 conda-forge pure_eval 0.2.2 pyhd8ed1ab_0 conda-forge pycparser 2.21 pypi_0 pypi pygments 2.12.0 pyhd8ed1ab_0 conda-forge pyparsing 3.0.8 pyhd8ed1ab_0 conda-forge pyrsistent 0.18.1 pypi_0 pypi python 3.10.4 h1cc4136_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python_abi 3.10 2_cp310 conda-forge pytz 2022.1 pypi_0 pypi pyzmq 22.3.0 py310h138f930_2 conda-forge readline 8.1 h05e3726_0 conda-forge requests 2.27.1 pypi_0 pypi send2trash 1.8.0 pypi_0 pypi setuptools 62.1.0 py310h2ec42d9_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge sniffio 1.2.0 pypi_0 pypi soupsieve 2.3.2.post1 pypi_0 pypi sqlite 3.38.2 hb516253_0 conda-forge stack_data 0.2.0 pyhd8ed1ab_0 conda-forge terminado 0.13.3 pypi_0 pypi tinycss2 1.1.1 pypi_0 pypi tk 8.6.12 h5dbffcc_0 conda-forge tornado 6.1 py310h1961e1f_3 conda-forge traitlets 5.1.1 pyhd8ed1ab_0 conda-forge tzdata 2022a h191b570_0 conda-forge urllib3 1.26.9 pypi_0 pypi wcwidth 0.2.5 pyh9f0ad1d_2 conda-forge webencodings 0.5.1 pypi_0 pypi websocket-client 1.3.2 pypi_0 pypi wheel 0.37.1 pyhd8ed1ab_0 conda-forge xz 5.2.5 haf1e3a3_1 conda-forge zeromq 4.3.4 he49afe7_1 conda-forge zlib 1.2.11 h6c3fc93_1014 conda-forge conda env: name: /tmp/conda_envs/bc2fdad912ee02a6c613fd97 channels: - conda-forge - defaults dependencies: - appnope=0.1.3=pyhd8ed1ab_0 - asttokens=2.0.5=pyhd8ed1ab_0 - backcall=0.2.0=pyh9f0ad1d_0 - backports=1.0=py_2 - backports.functools_lru_cache=1.6.4=pyhd8ed1ab_0 - bzip2=1.0.8=h0d85af4_4 - ca-certificates=2021.10.8=h033912b_0 - debugpy=1.6.0=py310h9d931ec_0 - decorator=5.1.1=pyhd8ed1ab_0 - entrypoints=0.4=pyhd8ed1ab_0 - executing=0.8.3=pyhd8ed1ab_0 - ipdb=0.13.9=pyhd8ed1ab_0 - ipykernel=6.13.0=py310ha188af9_0 - ipython=8.2.0=py310h2ec42d9_0 - jedi=0.18.1=py310h2ec42d9_1 - jupyter_client=7.3.0=pyhd8ed1ab_0 - jupyter_core=4.9.2=py310h2ec42d9_0 - libcxx=13.0.1=hc203e6f_0 - libffi=3.4.2=h0d85af4_5 - libsodium=1.0.18=hbcb3906_1 - libzlib=1.2.11=h6c3fc93_1014 - matplotlib-inline=0.1.3=pyhd8ed1ab_0 - ncurses=6.3=h96cf925_1 - nest-asyncio=1.5.5=pyhd8ed1ab_0 - openssl=3.0.2=h6c3fc93_1 - packaging=21.3=pyhd8ed1ab_0 - parso=0.8.3=pyhd8ed1ab_0 - pexpect=4.8.0=pyh9f0ad1d_2 - pickleshare=0.7.5=py_1003 - pip=22.0.4=pyhd8ed1ab_0 - prompt-toolkit=3.0.29=pyha770c72_0 - psutil=5.9.0=py310h1961e1f_1 - ptyprocess=0.7.0=pyhd3deb0d_0 - pure_eval=0.2.2=pyhd8ed1ab_0 - pygments=2.12.0=pyhd8ed1ab_0 - pyparsing=3.0.8=pyhd8ed1ab_0 - python=3.10.4=h1cc4136_0_cpython - python-dateutil=2.8.2=pyhd8ed1ab_0 - python_abi=3.10=2_cp310 - pyzmq=22.3.0=py310h138f930_2 - readline=8.1=h05e3726_0 - setuptools=62.1.0=py310h2ec42d9_0 - six=1.16.0=pyh6c4a22f_0 - sqlite=3.38.2=hb516253_0 - stack_data=0.2.0=pyhd8ed1ab_0 - tk=8.6.12=h5dbffcc_0 - tornado=6.1=py310h1961e1f_3 - traitlets=5.1.1=pyhd8ed1ab_0 - tzdata=2022a=h191b570_0 - wcwidth=0.2.5=pyh9f0ad1d_2 - wheel=0.37.1=pyhd8ed1ab_0 - xz=5.2.5=haf1e3a3_1 - zeromq=4.3.4=he49afe7_1 - zlib=1.2.11=h6c3fc93_1014 - pip: - anyio==3.5.0 - argon2-cffi==21.3.0 - argon2-cffi-bindings==21.2.0 - attrs==21.4.0 - babel==2.10.1 - beautifulsoup4==4.11.1 - bleach==5.0.0 - certifi==2021.10.8 - cffi==1.15.0 - charset-normalizer==2.0.12 - defusedxml==0.7.1 - fastjsonschema==2.15.3 - idna==3.3 - ipython-genutils==0.2.0 - jinja2==3.1.1 - json5==0.9.6 - jsonschema==4.4.0 - jupyter-server==1.17.0 - jupyterlab==3.3.4 - jupyterlab-pygments==0.2.2 - jupyterlab-server==2.13.0 - markupsafe==2.1.1 - mistune==0.8.4 - nbclassic==0.3.7 - nbclient==0.6.0 - nbconvert==6.5.0 - nbformat==5.3.0 - notebook==6.4.11 - notebook-shim==0.1.0 - pandocfilters==1.5.0 - prometheus-client==0.14.1 - pycparser==2.21 - pyrsistent==0.18.1 - pytz==2022.1 - requests==2.27.1 - send2trash==1.8.0 - sniffio==1.2.0 - soupsieve==2.3.2.post1 - terminado==0.13.3 - tinycss2==1.1.1 - urllib3==1.26.9 - webencodings==0.5.1 - websocket-client==1.3.2 prefix: /tmp/conda_envs/bc2fdad912ee02a6c613fd97
ruomad commented 2 years ago

Hello and thanks for your answer. I use poetry with python 3.10 on windows 10. Native Python installer (not msys2). The output below is after downgrading :

WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the 'C:\Users\####\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\Scripts\python.exe -m pip install --upgrade pip' command.
$PATH:
        C:\Users\####\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\Scripts
        C:\Users\####\AppData\Local\Programs\local\bin
        C:\Users\####\AppData\Local\Programs\Python\Python310
sys.path:
        C:\Users\####\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\Scripts\jupyter-troubleshoot.EXE
        C:\Users\DAMOUR\AppData\Local\Programs\Python\Python310\python310.zip
        C:\Users\DAMOUR\AppData\Local\Programs\Python\Python310\DLLs
        C:\Users\DAMOUR\AppData\Local\Programs\Python\Python310\lib
        C:\Users\DAMOUR\AppData\Local\Programs\Python\Python310
        C:\Users\DAMOUR\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10
        C:\Users\DAMOUR\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\lib\site-packages
        C:\Users\DAMOUR\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\lib\site-packages\win32
        C:\Users\DAMOUR\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\lib\site-packages\win32\lib
        C:\Users\DAMOUR\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\lib\site-packages\Pythonwin

sys.executable:
        C:\Users\DAMOUR\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\Scripts\python.exe

sys.version:
        3.10.4 (tags/v3.10.4:9d38120, Mar 23 2022, 23:13:41) [MSC v.1929 64 bit (AMD64)]

platform.platform():
        Windows-10-10.0.19042-SP0

where jupyter:
        C:\Users\####\AppData\Local\pypoetry\Cache\virtualenvs\azlab-TXIRGxn6-py3.10\Scripts\jupyter.exe

pip list:
        Package              Version
        -------------------- -----------
        anyio                3.5.0
        argon2-cffi          21.3.0
        argon2-cffi-bindings 21.2.0
        asttokens            2.0.5
        atomicwrites         1.4.0
        attrs                21.4.0
        Babel                2.10.1
        backcall             0.2.0
        beautifulsoup4       4.11.1
        bleach               5.0.0
        certifi              2021.10.8
        cffi                 1.15.0
        charset-normalizer   2.0.12
        colorama             0.4.4
        cryptography         36.0.2
        cycler               0.11.0
        debugpy              1.6.0
        decorator            5.1.1
        defusedxml           0.7.1
        entrypoints          0.4
        et-xmlfile           1.1.0
        executing            0.8.3
        fastjsonschema       2.15.3
        fonttools            4.33.3
        greenlet             1.1.2
        h11                  0.12.0
        h2                   4.1.0
        hpack                4.0.0
        httpcore             0.14.7
        httpx                0.22.0
        hyperframe           6.0.1
        idna                 3.3
        iniconfig            1.1.1
        ipykernel            6.13.0
        ipython              8.2.0
        ipython-genutils     0.2.0
        ipywidgets           8.0.0rc0
        jedi                 0.18.1
        Jinja2               3.1.1
        json5                0.9.6
        jsonschema           4.4.0
        jupyter-client       7.2.2
        jupyter-core         4.10.0
        jupyter-server       1.16.0
        jupyterlab           3.3.4
        jupyterlab-pygments  0.2.2
        jupyterlab-server    2.13.0
        jupyterlab-widgets   3.0.0rc0
        kiwisolver           1.4.2
        MarkupSafe           2.1.1
        matplotlib           3.5.1
        matplotlib-inline    0.1.3
        mistune              0.8.4
        nbclassic            0.3.7
        nbclient             0.5.13
        nbconvert            6.5.0
        nbformat             5.3.0
        nest-asyncio         1.5.5
        notebook             6.4.11
        notebook-shim        0.1.0
        numpy                1.22.3
        openpyxl             3.0.9
        packaging            21.3
        pandas               1.4.2
        pandocfilters        1.5.0
        parso                0.8.3
        pickleshare          0.7.5
        Pillow               9.1.0
        pip                  22.0.3
        pluggy               1.0.0
        prometheus-client    0.14.1
        prompt-toolkit       3.0.29
        psutil               5.9.0
        psycopg2             2.9.3
        pure-eval            0.2.2
        py                   1.11.0
        pycparser            2.21
        Pygments             2.12.0
        pyparsing            3.0.8
        PyPDF2               1.27.9
        pyrsistent           0.18.1
        pytest               7.1.2
        python-dateutil      2.8.2
        pytz                 2022.1
        pywin32              303
        pywinpty             2.0.5
        pyzmq                22.3.0
        reportlab            3.6.9
        requests             2.27.1
        rfc3986              1.5.0
        Send2Trash           1.8.0
        setuptools           60.6.0
        setuptools-scm       6.4.2
        six                  1.16.0
        sniffio              1.2.0
        soupsieve            2.3.2.post1
        SQLAlchemy           1.4.36
        stack-data           0.2.0
        terminado            0.13.3
        tinycss2             1.1.1
        tomli                2.0.1
        tornado              6.1
        traitlets            5.1.1
        urllib3              1.26.9
        utils                1.0.6
        voila                0.3.5
        wcwidth              0.2.5
        webencodings         0.5.1
        websocket-client     1.3.2
        websockets           10.3
        wheel                0.37.1
        widgetsnbextension   4.0.0rc0
blink1073 commented 2 years ago

I think this is the same error is https://github.com/jupyterlab/jupyterlab/issues/11934. Are you seeing a similar traceback?

ruomad commented 2 years ago

Hum, yes I think the traceback was similar. I'll re-upgrade and send a traceback

ruomad commented 2 years ago

Well, I upgraded

$ poetry update
Updating dependencies
Resolving dependencies... (283.6s)

Writing lock file

Package operations: 0 installs, 3 updates, 0 removals

  • Updating jupyter-client (7.2.2 -> 7.3.0)
  • Updating jinja2 (3.1.1 -> 3.1.2)
  • Updating jupyter-server (1.16.0 -> 1.17.0)

But could not reproduce the error (so far) so it seems more random than I thought... The only difference is jinja2 was also upgraded, but I tried to downgrade, and still no error.

I'll stay with these new versions and keep you posted.

blink1073 commented 2 years ago

Great, thanks for helping to diagnose