Reputation: 21
I'm getting this error while trying to run my .ipynb files using VSCode: 'Failed to start the Kernel. Unable to start Kernel 'Python 3.11.4' due to a timeout waiting for the ports to get used.'
Python 3.11.4, Python, Pylance and Jupyter extensions and required packages like ipykernel are installed and up to date. It was working a few hours ago and I don't know what's wrong right now. I can still run my older notebook files but not the new ones.
In the logs, I'm seeing this error: 'Error: Unable to start Kernel 'Python 3.11.4' due to a timeout waiting for the ports to get used.'
Tried reinstalling VSCode, extensions, Python interpreter and packages like ipykernel but it did not fix the issue. Tried running with and without VPN but it also did not help.
What can I do?
Edit: I figured out that this error occures only in a specific folder. It even works in the subfolders of it. I still have no idea what's wrong.
Upvotes: 2
Views: 6610
Reputation: 1
The reason for this is that the port is busy with another process So, press Ctrl Shift Escape to enter the task manager, then choose VS Code and end its task, then open it again and it will execute the file normally.
Upvotes: 0
Reputation: 33
I got the same error. Then I opened a terminal in VS Code and I was able to run the notebook.
Upvotes: 2
Reputation: 9437
due to a timeout waiting for the ports to get used.
Upvotes: -3