microsoft / vscode-black-formatter

Formatting support for Python using the Black formatter
https://marketplace.visualstudio.com/items?itemName=ms-python.black-formatter
MIT License
146 stars 35 forks source link

ImportError: cannot import name 'Buffer' from 'typing_extensions' #378

Closed willjhenry closed 8 months ago

willjhenry commented 8 months ago

Getting the following error since the most recent update:

2023-11-09 11:56:52.520 [info] from typing_extensions import Buffer ImportError: cannot import name 'Buffer' from 'typing_extensions' (/Users/xyz/Documents/Elate_App/app_envs/app_p311/lib/python3.11/site-packages/typing_extensions.py)

2023-11-09 11:56:52.594 [info] [Error - 11:56:52 AM] Server initialization failed. 2023-11-09 11:56:52.594 [info] Message: Pending response rejected since connection got disposed Code: -32097

My python env is 3.11. I am seeing online that 'Buffer' was added to typing_extensions in 3.12 (not sure if that is accurate, but that is from an initial google search)

karthiknadig commented 8 months ago

See comment here for solutions: https://github.com/microsoft/vscode-black-formatter/issues/265#issuecomment-1804712227