8000 TypeError: type 'List' is not subscriptable when running python3 -m IPython on Python 3.11 · Issue #14903 · ipython/ipython · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

TypeError: type 'List' is not subscriptable when running python3 -m IPython on Python 3.11 #14903

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

Open
BorisQuanLi opened this issue May 23, 2025 · 4 comments

Comments

@BorisQuanLi
Copy link

Problem

When running python3 -m IPython after following the development setup instructions, I get the following error:

Traceback (most recent call last):
  ...
TypeError: type 'List' is not subscriptable
  • Python version: 3.11.3
  • OS: macOS

Steps to reproduce

  1. Clone the repo
  2. Follow the development install instructions
  3. Run python3 -m IPython

Additional info

This blocks running IPython from source. Please advise if there's a workaround or if the docs need updating.

Output of python -c "import IPython; print(IPython.sys_info())":

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  ...
  File "/path/to/ipython/IPython/core/interactiveshell.py", line 338, in InteractiveShell
    ast_transformers: List[ast.NodeTransformer] = List(
                      ~~~~^^^^^^^^^^^^^^^^^^^^^
TypeError: type 'List' is not subscriptable
@BorisQuanLi
Copy link
Author

Hi all,

To help future contributors avoid this installation pitfall, I plan to submit a PR improving the documentation. Specifically, I’ll update the installation instructions to recommend:

Before running python3 -m IPython or, when installing from source, pip install -e ., users should create and activate a Python virtual environment.

I’ll reference this issue in the PR.

Thanks!

@krassowski
Copy link
Member

I think the issue here is that you had an old version of traitlets installed.

@BorisQuanLi
Copy link
Author

@krassowski Thank you for the insight! That makes sense—having an outdated version of traitlets in the global environment could definitely cause issues.

Would you agree that this highlights the importance of activating a fresh virtual environment before installing IPython from source? It seems to help ensure all dependencies are up to date and avoid conflicts with system packages.

I’ll incorporate this recommendation into my upcoming documentation PR.

Thanks again!

@krassowski
Copy link
Member

Yes, I think that it would be good to include the recommendation to use a virtual env for development.

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

2 participants
0