OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

sys.excepthook AssertionError when trying to start Jupyter server

  • Thread starter Thread starter Elis Evans
  • Start date Start date
E

Elis Evans

Guest
After having pip installed jupyter on a VM (Linux Ubuntu 22.10, Python 3.10.7), running jupyter notebook gives the error

Code:
  File "/home/username/.local/bin/jupyter-notebook", line 5, in <module>
    from notebook.app import main
  File "/home/username/.local/lib/python3.10/site-packages/notebook/app.py", line 17, in <module>
    from jupyter_server.serverapp import flags
  File "/home/username/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 114, in <module>
    from jupyter_server.services.contents.filemanager import (
  File "/home/username/.local/lib/python3.10/site-packages/jupyter_server/services/contents/filemanager.py", line 23, in <module>
    from anyio.to_thread import run_sync
  File "/home/username/.local/lib/python3.10/site-packages/anyio/__init__.py", line 27, in <module>
    from ._core._sockets import connect_tcp as connect_tcp
  File "/home/username/.local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 35, in <module>
    from exceptiongroup import ExceptionGroup
  File "/home/username/.local/lib/python3.10/site-packages/exceptiongroup/__init__.py", line 20, in <module>
    from ._formatting import (
  File "/home/username/.local/lib/python3.10/site-packages/exceptiongroup/_formatting.py", line 394, in <module>
    assert sys.excepthook is apport_python_hook.apport_excepthook
AssertionError

I have tried doing

Code:
sys.excepthook = sys.__excepthook__

as mentioned here but this doesn't change the output. How do I fix this?
<p>After having pip installed <code>jupyter</code> on a VM (Linux Ubuntu 22.10, Python 3.10.7), running <code>jupyter notebook</code> gives the error</p>
<pre><code> File "/home/username/.local/bin/jupyter-notebook", line 5, in <module>
from notebook.app import main
File "/home/username/.local/lib/python3.10/site-packages/notebook/app.py", line 17, in <module>
from jupyter_server.serverapp import flags
File "/home/username/.local/lib/python3.10/site-packages/jupyter_server/serverapp.py", line 114, in <module>
from jupyter_server.services.contents.filemanager import (
File "/home/username/.local/lib/python3.10/site-packages/jupyter_server/services/contents/filemanager.py", line 23, in <module>
from anyio.to_thread import run_sync
File "/home/username/.local/lib/python3.10/site-packages/anyio/__init__.py", line 27, in <module>
from ._core._sockets import connect_tcp as connect_tcp
File "/home/username/.local/lib/python3.10/site-packages/anyio/_core/_sockets.py", line 35, in <module>
from exceptiongroup import ExceptionGroup
File "/home/username/.local/lib/python3.10/site-packages/exceptiongroup/__init__.py", line 20, in <module>
from ._formatting import (
File "/home/username/.local/lib/python3.10/site-packages/exceptiongroup/_formatting.py", line 394, in <module>
assert sys.excepthook is apport_python_hook.apport_excepthook
AssertionError
</code></pre>
<p>I have tried doing</p>
<pre><code>sys.excepthook = sys.__excepthook__
</code></pre>
<p>as mentioned <a href="https://stackoverflow.com/questions/13841996/how-to-get-root-of-the-apport-sys-excepthook">here</a> but this doesn't change the output. How do I fix this?</p>
 

Latest posts

Top