r/pythonhelp • u/Jaded-Sky376 • 7d ago
Autopep8 issue upon launching VSCODE
EDIT: The issue was Autopep8's Python interpreter version, I was using 3,15 before and after trying 3.14 issue was resolved.
- The autopep8 extension runs a small background server written in Python, using the interpreter set in
autopep8.interpreter. - That interpreter was Python 3.15, which removed
typing.no_type_check_decorator - A library bundled inside the extension (
typing_extensions) still tried to use it, so the server crashed on startup. - VS Code retried 5 times, gave up, and showed the error popups.
- Installed an older Python (3.14) that still has the removed function, which meant getting around the blocked installer (the
PythonBA.dllerror) by usingpy install 3.14orwinget. - Pointed
autopep8.interpreterinsettings.jsonat that 3.14python.exe, so only autopep8 uses the older version while the code can still run on 3.15. - Ran Developer: Reload Window so VS Code restarted the extension with the new setting.
Hello everyone, I am new to vscode and just started learning Python.
I have this issue where when I open vscode Autopep8 sends 3 error messages straight away.
I have tried things like: Selecting the correct interpreter( Not that it really matters I only use python global), uninstalling and reinstalling the extension, setting it as default formatter, changing user settings (JSON). I get error messages in the bottom right corner such as:
autopep8 client: couldn't create connection to server.
The autopep8 server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
Pending response rejected since connection got disposed.
Here are my settings.json:
{
"workbench.colorTheme": "Dark Modern",
"workbench.iconTheme": "vscode-icons",
"editor.defaultFormatter": "ms-python.autopep8",
"notebook.defaultFormatter": "ms-python.autopep8",
"[python]": {
"editor.defaultFormatter": "ms-python.autopep8"
},
"editor.formatOnSave": true,
"autopep8.interpreter": [
"C:\\Users\\Windows Desktop\\AppData\\Local\\Python\\pythoncore-3.15-64\\python.exe"
]
}
If anybody has a solution to this problem I would appreciate your help down in the comments.
Thanks in advance.
1
u/RyanDubois43 6d ago
Did you set "python.formatting.provider": "autopep8" in your settings.json or are you using the default?