ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

Home Page:https://ipython.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

In Python 3.10.14 ipython raises cannot import name 'TypeAliasType' from 'typing_extensions' and kernel not responding

a3626a opened this issue · comments

In my jupyter hub + jupyter lab + Python 3.10.14 environment, this is the pip list result.

Package                        Version
------------------------------ --------------
absl-py                        2.1.0
aiohttp                        3.9.3
aiosignal                      1.3.1
alembic                        1.13.1
anyio                          4.3.0
argon2-cffi                    23.1.0
argon2-cffi-bindings           21.2.0
arrow                          1.3.0
asttokens                      2.4.1
astunparse                     1.6.3
async-generator                1.10
async-lru                      2.0.4
async-timeout                  4.0.3
attrs                          23.2.0
autobahn                       23.6.2
Babel                          2.14.0
beautifulsoup4                 4.12.3
bleach                         6.1.0
boto3                          1.34.80
botocore                       1.34.80
branca                         0.7.1
cachetools                     5.3.3
certifi                        2024.2.2
certipy                        0.1.3
cffi                           1.16.0
charset-normalizer             3.3.2
ColabTurtlePlus                2.0.1
comm                           0.2.2
cryptography                   42.0.5
cycler                         0.12.1
debugpy                        1.8.1
decorator                      5.1.1
defusedxml                     0.7.1
entrypoints                    0.4
exceptiongroup                 1.2.0
executing                      2.0.1
fastjsonschema                 2.19.1
flatbuffers                    24.3.25
folium                         0.16.0
fonttools                      4.50.0
fqdn                           1.5.1
frozenlist                     1.4.1
gast                           0.4.0
google-auth                    2.29.0
google-auth-oauthlib           1.0.0
google-pasta                   0.2.0
greenlet                       3.0.3
grpcio                         1.62.1
h5py                           3.10.0
hyperlink                      21.0.0
idna                           3.6
ipycanvas                      0.12.0
ipydoodle                      0.1.2
ipykernel                      6.29.3
ipython                        8.23.0
ipython-genutils               0.2.0
ipywidgets                     8.1.2
isoduration                    20.11.0
jcecodle                       1.54.0b0
jcetheme_light                 1.6.1b0
jedi                           0.19.1
Jinja2                         3.1.3
jmespath                       1.0.1
joblib                         1.3.2
json5                          0.9.24
jsonpointer                    2.4
jsonschema                     4.21.1
jsonschema-specifications      2023.12.1
jupyter                        1.0.0
jupyter-archive                3.4.0
jupyter_client                 7.4.9
jupyter-console                6.6.3
jupyter_core                   5.7.2
jupyter-events                 0.10.0
jupyter-lsp                    2.2.4
jupyter_server                 2.13.0
jupyter_server_proxy           4.1.2
jupyter_server_terminals       0.5.3
jupyter-telemetry              0.1.0
jupyterhub                     3.0.0
jupyterlab                     4.0.13
jupyterlab_google_analytics    1.2.0
jupyterlab_judge               1.24.1
jupyterlab-language-pack-ko-KR 4.1.post2
jupyterlab_pygments            0.3.0
jupyterlab_server              2.25.4
jupyterlab_vpython             3.1.6
jupyterlab_widgets             3.0.10
keras                          2.13.1
kiwisolver                     1.4.5
libclang                       18.1.1
llvmlite                       0.42.0
Mako                           1.3.2
Markdown                       3.6
MarkupSafe                     2.1.5
matplotlib                     3.5.2
matplotlib-inline              0.1.6
mistune                        3.0.2
multidict                      6.0.5
nbclassic                      1.0.0
nbclient                       0.10.0
nbconvert                      7.16.3
nbformat                       5.10.3
nest-asyncio                   1.6.0
notebook                       6.5.6
notebook_shim                  0.2.4
numba                          0.59.1
numpy                          1.22.4
oauthlib                       3.2.2
opencv-python-headless         4.6.0.66
opt-einsum                     3.3.0
overrides                      7.7.0
packaging                      24.0
pamela                         1.1.0
pandas                         2.0.2
pandocfilters                  1.5.1
parso                          0.8.3
pexpect                        4.9.0
Pillow                         9.1.1
pip                            23.0.1
platformdirs                   4.2.0
prometheus_client              0.20.0
prompt-toolkit                 3.0.43
protobuf                       4.25.3
psutil                         5.9.8
ptyprocess                     0.7.0
pure-eval                      0.2.2
pyasn1                         0.5.1
pyasn1-modules                 0.3.0
PyAudio                        0.2.14
pycparser                      2.21
Pygments                       2.17.2
pynndescent                    0.5.11
pyOpenSSL                      24.1.0
pyparsing                      3.1.2
python-dateutil                2.9.0.post0
python-json-logger             2.0.7
pytz                           2024.1
PyYAML                         6.0.1
pyzmq                          24.0.1
qtconsole                      5.5.1
QtPy                           2.4.1
referencing                    0.34.0
requests                       2.31.0
requests-oauthlib              2.0.0
rfc3339-validator              0.1.4
rfc3986-validator              0.1.1
rpds-py                        0.18.0
rsa                            4.9
ruamel.yaml                    0.18.6
ruamel.yaml.clib               0.2.8
s3transfer                     0.10.1
scikit-learn                   1.1.1
scipy                          1.12.0
seaborn                        0.13.2
Send2Trash                     1.8.2
sentry-sdk                     1.30.0
setuptools                     65.5.1
simpervisor                    1.0.0
six                            1.16.0
sniffio                        1.3.1
soupsieve                      2.5
SQLAlchemy                     2.0.24
stack-data                     0.6.3
tensorboard                    2.13.0
tensorboard-data-server        0.7.2
tensorflow-cpu                 2.13.1
tensorflow-estimator           2.13.0
tensorflow-io-gcs-filesystem   0.36.0
termcolor                      2.4.0
terminado                      0.18.1
threadpoolctl                  3.4.0
tinycss2                       1.2.1
tomli                          2.0.1
tornado                        6.4
tqdm                           4.66.2
traitlets                      5.14.2
txaio                          23.1.1
types-python-dateutil          2.9.0.20240316
typing_extensions              4.5.0
tzdata                         2024.1
umap-learn                     0.5.5
uri-template                   1.3.0
urllib3                        2.2.1
vpython                        7.6.4
wcwidth                        0.2.13
webcolors                      1.13
webencodings                   0.5.1
websocket-client               1.7.0
Werkzeug                       3.0.1
wheel                          0.43.0
widgetsnbextension             4.0.10
wrapt                          1.16.0
xyzservices                    2023.10.1
yarl                           1.9.4

In this environment, jupyter lab works properly.

After I installed new version of ipython (8.23.0)

pip install ipython==8.23.0

Ipyython kernel does not respond to anything.
image
For this simple example, after executing the code,

the kerenl is dead, the following is logged in the chrome console.

WebSocket connection to 'wss://<SOME-DOMAIN>/user/<SOME-USER>/api/kernels/944388b2-98af-4b38-a1fa-fa67dea72fed/channels?session_id=e4ff9800-ff5a-4269-9437-96850b6e5d54' failed: WebSocket is closed before the connection is established.

And this is server-side log

ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (/usr/local/lib/python3.10/site-packages/typing_extensions.py)

Causes

TypeAliasType is introduced in typing_extensions==4.6.0. My environment is still using typing_extensions==4.5.0

duplicate of #14389. close