Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No required version of typing_extensions is causing ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' #14380

Closed
r00ta opened this issue Apr 2, 2024 · 1 comment · Fixed by #14381
Milestone

Comments

@r00ta
Copy link

r00ta commented Apr 2, 2024

There are no version requirements on typing_extensions

"typing_extensions; python_version<'3.12'",

but actually you are importing

from typing_extensions import TypeAliasType

here

from typing_extensions import TypeAliasType

and TypeAliasType has been added only in 4.6 python/typing_extensions@09c1ed4.

This means that if a system has already typing_extensions at version 4.4.0 (for example, on Ubuntu Jammy the deb package python3-typing-extensions is at version 4.4.0) pip will assume that 4.4.0 is ok, but you would end up with

Traceback (most recent call last):
  File "/work/maas/bin/py", line 5, in <module>
    from IPython import start_ipython
  File "/work/maas/.ve/lib/python3.10/site-packages/IPython/__init__.py", line 55, in <module>
    from .terminal.embed import embed
  File "/work/maas/.ve/lib/python3.10/site-packages/IPython/terminal/embed.py", line 16, in <module>
    from IPython.terminal.interactiveshell import TerminalInteractiveShell
  File "/work/maas/.ve/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 48, in <module>
    from .debugger import TerminalPdb, Pdb
  File "/work/maas/.ve/lib/python3.10/site-packages/IPython/terminal/debugger.py", line 6, in <module>
    from IPython.core.completer import IPCompleter
  File "/work/maas/.ve/lib/python3.10/site-packages/IPython/core/completer.py", line 219, in <module>
    from IPython.core.guarded_eval import guarded_eval, EvaluationContext
  File "/work/maas/.ve/lib/python3.10/site-packages/IPython/core/guarded_eval.py", line 40, in <module>
    from typing_extensions import TypeAliasType
ImportError: cannot import name 'TypeAliasType' from 'typing_extensions' (/usr/lib/python3/dist-packages/typing_extensions.py)

Tested on

Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.3 LTS
Release:	22.04
Codename:	jammy
@krassowski
Copy link
Member

Thanks! I opened #14381.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants