2

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.

2
  • related error message at stackoverflow.com/q/76551122/11107541. Does that Q&A help you at all? Commented Aug 9, 2023 at 21:52
  • This can be due to the tornado version. Ensure that it is greater than 6.2. Commented Sep 25, 2023 at 18:16

3 Answers 3

4

I got the same error. Then I opened a terminal in VS Code and I was able to run the notebook.

Sign up to request clarification or add additional context in comments.

2 Comments

This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review
I had the same issue and opening a terminal also worked for me. It seems this is a valid answer to the issue.
0

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.

Comments

-3

due to a timeout waiting for the ports to get used.

  1. Try to restart your computer.
  2. Check if there is a firewall blocking the connection.
  3. Check if there are any other processes running that might be using the required ports.

7 Comments

I tried restarting multiple times and also tried turning firewall off, but did not work either.
@Supermani Are you using jupyter locally or remotely?
I'm using it locally.
@Supermani Have you tried to choose the python interpreter and rechosen the jupyter kernl?
Yes I chose Python environments >> Python 3.11.4. The error only occurs in a specific folder and does not occur in other folders.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.