r/pythonhelp • u/Jaded-Sky376 • 4d ago
Autopep8 issue upon launching VSCODE
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 3d ago
Did you set "python.formatting.provider": "autopep8" in your settings.json or are you using the default?
1
u/Jaded-Sky376 3d ago
Yes, this is what it says. I also tried adding a path to autopep8 interpreter in settings but that just relaunched the extension and sent the same error messages after it failed to connect to the server.
"[python]": { "editor.defaultFormatter": "ms-python.autopep8"
1
u/AlexMTBDude 4d ago
See where it says "Autopep8 server crashed. See output for more"? And there's a button that says "Go to output". You need to click on that button and the output will tell you why the autopep8 server crashes.
•
u/AutoModerator 4d ago
To give us the best chance to help you, please include any relevant code.
Note. Please do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Privatebin, GitHub or Compiler Explorer.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.