-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jupyter Notebook fails to run code with OSError and RunTimeError. #7433
Comments
OSError: [WinError 10038] is occasionally caused by firewalls or network policies that might disrupt socket operations. Check the firewall settings to allow jupyter to establish connections properly. Based on the research i did on reddit, the cause and how to solve the runtime error RuntimeError: Event loop is closed often arises in asynchronous contexts particularly around asyncio and other event-driven libraries. So try these approaches:
|
Hi, appreciate the response. Regarding the OSError, the firewall doesn't seem to be the problem - disabling all Windows firewalls did not resolve the issue. On the RuntimeError: all packages are up to date, and I will try later inserting the event loop policy code but that will probably require a complete rebuild of jupyter. I also tried a complete purge and reinstall of all Python and associated folders, and tried installing with conda, but errors persist. Strangely, the errors only happen about 70% of the time - restarting the server multiple times sometimes results in no errors, and sometimes the server completely shuts down while other times it remains open. Other errors I am seeing are 404 errors where it cannot find the kernel, but again, this only happens occasionally and not all the time. Full shutdown (crashes completely and stops server, 2x OSError, no firewall):
Partial shutdown (OSError and RuntimeError, doesn't completely crash but doesn't run any code, shows
|
Tried to use a clean venv as well; still doesn't work. Workaround for now is to restart the server around ~4 times until it works for some reason. |
Hi @appleplectic, just as with #7432, could you please try the fix that people found in #5435? |
Thanks for the response. Unfortunately, it doesn't work:
c = get_config()
c.NotebookApp.ip = "127.0.0.1" (Didn't find c.NotebookApp.ip to uncomment; tried c.ServerApp.ip as well) Also tried Error:
|
try to uninstall and install pyzmq == 19.0.2 then restart the jupyter... if you encounter an error message "jupyter command not found" try reinstalling jupyter |
It does appear to work after downgrading to Python 3.8, Jupyter Notebook 6.5.7, and pyzmq 19.0.2, although I do need newer versions of Python that won't be EOL'd in two months. |
Thank you for the updates @appleplectic, can try reproducing this error with Python 3.12 and the latest version of Notebook in a new conda environment. |
Yes, the error is reproducible in a clean conda environment with Python 3.12.5 via conda and notebook 7.2.1. |
Description
Cannot run any code through the web interface or third party interfaces like PyCharm - errors with
OSError: [WinError 10038] An operation was attempted on something that is not a socket
andRuntimeError: Event loop is closed
.Reproduce
Run
jupyter notebook
Open the link and create a new notebook.
Run
print("Hello")
Expected behavior
Prints "hello"
Context
Troubleshoot Output
Command Line Output
The text was updated successfully, but these errors were encountered: