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

TypeError: in interactiveshell.py, InteractiveShell class, line 331 #14358

Closed
manish-abio opened this issue Mar 1, 2024 · 5 comments
Closed

Comments

@manish-abio
Copy link

Errror:

"/home/ec2-user/anaconda3/envs/JupyterSystemEnv/lib/python3.10/site-packages/IPython/core/interactiveshell.py", line 331, in InteractiveShell
ast_transformers: List[ast.NodeTransformer] = List(
TypeError: 'type' object is not subscriptable

Solution:

Line 331 should be changed to:
ast_transformers: List = List(

@DrManishSharma
Copy link

Added a pull request #14359

@krassowski
Copy link
Member

@manish-abio @DrManishSharma this issue looks like a duplicate of #14352 which was fixed in #14353 and released in 8.22.1; you are most likely either running 8.22.0 rather than patched 8.22.1, or have incompatible version of traitlets installed.

@RobChad
Copy link

RobChad commented Mar 7, 2024

I'm running a freshly installed 8.22.2 with this issue
downgrading to 8.22.1, I still have this issue
8.21.0 works

I'm on python 3.10.13

@AntoineHus
Copy link

Hello,

I have the "TypeError: type 'List' is not subscriptable" on Python 3.11 with sage 10.3 when I tried to launch It interactive on the CLI.

File "/private/var/tmp/sage-10.3-current/local/var/lib/sage/venv-python3.11.8/lib/python3.11/site-packages/IPython/core/interactiveshell.py", line 331, in InteractiveShell
ast_transformers: List[ast.NodeTransformer] = List(
~~~~^^^^^^^^^^^^^^^^^^^^^

@krassowski
Copy link
Member

@RobChad @AntoineHus you need to upgrade traitlets to v5.13 or newer. The pin was added in #14353 but your solver (whichever way you installed IPython may not have picked the correct version). I will close this issue as a duplicate, but if you still experience the problem with the required version of traitlets installed feel free to ask for help (the issue may be that you have two versions installed, for example if mixing pip and conda).

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

No branches or pull requests

5 participants