Jupyter-notebook is not running

When I try to run jupyter-notebook

[I 18:07:35.305 NotebookApp] Serving notebooks from local directory: /home/jcristia
[I 18:07:35.305 NotebookApp] Jupyter Notebook 6.4.8 is running at:
[I 18:07:35.305 NotebookApp] http://localhost:8888/?token=f94c6d4ee95de8ad9d1899ae3eb9ed460d433b46579f0dad
[I 18:07:35.305 NotebookApp]  or http://127.0.0.1:8888/?token=f94c6d4ee95de8ad9d1899ae3eb9ed460d433b46579f0dad
[I 18:07:35.305 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 18:07:35.347 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/jcristia/.local/share/jupyter/runtime/nbserver-94315-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=f94c6d4ee95de8ad9d1899ae3eb9ed460d433b46579f0dad
     or http://127.0.0.1:8888/?token=f94c6d4ee95de8ad9d1899ae3eb9ed460d433b46579f0dad
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
002c:err:module:load_apiset_dll failed to load apiset: c0000482
0034:err:module:load_apiset_dll failed to load apiset: c0000482
003c:err:module:load_apiset_dll failed to load apiset: c0000482
0048:err:module:load_apiset_dll failed to load apiset: c0000482
0068:err:module:load_apiset_dll failed to load apiset: c0000482
0080:err:module:load_apiset_dll failed to load apiset: c0000482
0094:err:module:load_apiset_dll failed to load apiset: c0000482
00ac:err:module:load_apiset_dll failed to load apiset: c0000482
00d0:err:module:load_apiset_dll failed to load apiset: c0000482
0024:err:module:load_apiset_dll failed to load apiset: c0000482
00f8:err:module:load_apiset_dll failed to load apiset: c0000482
0100:err:module:load_apiset_dll failed to load apiset: c0000482
0100:fixme:exec:SHELL_execute flags ignored: 0x00000100
0498:err:module:load_apiset_dll failed to load apiset: c0000482
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
048c:err:module:load_apiset_dll failed to load apiset: c0000482
04a8:err:module:load_apiset_dll failed to load apiset: c0000482
04c0:err:module:load_apiset_dll failed to load apiset: c0000482
0498:err:module:load_apiset_dll failed to load apiset: c0000482
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
048c:err:module:load_apiset_dll failed to load apiset: c0000482
04a8:err:module:load_apiset_dll failed to load apiset: c0000482
04c0:err:module:load_apiset_dll failed to load apiset: c0000482
0108:err:module:load_apiset_dll failed to load apiset: c0000482
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
kf.service.services: KApplicationTrader: mimeType "x-scheme-handler/file" not found
0110:err:module:load_apiset_dll failed to load apiset: c0000482
0118:err:module:load_apiset_dll failed to load apiset: c0000482
0120:err:module:load_apiset_dll failed to load apiset: c0000482
0120:fixme:exec:SHELL_execute flags ignored: 0x00000100
0128:err:module:load_apiset_dll failed to load apiset: c0000482
04ac:err:module:load_apiset_dll failed to load apiset: c0000482
^C[C 18:08:22.748 NotebookApp] received signal 2, stopping
[I 18:08:22.748 NotebookApp] Shutting down 0 kernels
[I 18:08:22.748 NotebookApp] Shutting down 0 terminals

I have tried a lot of things including

  • uninstalling and reinstalling jupyter-notebook with pip
  • uninstalling and reinstalling jupyter-notebook and jupyter with pacman -R
  • uninstalling and reinstalling ipython with pip

none have worked

How can I fix this?

Don’t use pip if you use the system Python.

Don’t use the system Python if you want to use pip.

3 Likes

Did you do this ?
From what i see, the jupyter-notebook from official repository should work just fine and simply install it with:
pamac install jupyter-notebook
or
sudo pacman -Syyu jupyter-notebook

A reboot might help and in case of doubt, maybe make a backup of ~/.local/share/jupyter/ and then remove it, then open jupyter-notebook again …

when letting jupyter-notebook --debug I still get the same output. When clicking on those links I have jupyter notebook open but every time I click a .ipynb I get a 500: Internal Server Error

Also a wine process is running and hanging
I can’t find and kill the process manually with htop

 ps -e | grep wine                                                                                    ✔ 
   7543 ?        00:01:40 wineserver
   7552 ?        00:00:00 winedevice.exe
   7560 ?        00:00:04 winedevice.exe
  39741 ?        00:00:00 winebrowser.exe
  39743 ?        00:00:00 winebrowser.exe

After using Ctrl+C on jupyter-notebook I get a error in a window from KIO Client

he file or folder /home/jcristia/.local/share/jupyter/runtime/nbserver-7516-open.html does not exist.
ps -e | grep wine                                                                                INT ✘ 

no more wine .

Could the problem be with wine?

Thanks for your feedback… do you know of any resource on how to reset both environments so that I can start fresh?

Looks like you have a BROWSER environment variable which is causing this. What is the output of echo $BROWSER? Also try to launch jupyter-notebook with these commands:

jupyter-notebook --browser=firefox #or chromium, xyz browser
#or
jupyter-notebook --NotebookApp.use_redirect_file=False

It does appear that you are right.
echo $BROWSER has no output

both commands you suggested had the same output.
The hanging wine process is gone.
I still get error 500 when trying to load .ipynb

jupyter-notebook  --browser=firefox                                                                  ✔ 
[I 10:08:19.583 NotebookApp] Serving notebooks from local directory: /home/jcristia
[I 10:08:19.583 NotebookApp] Jupyter Notebook 6.4.8 is running at:
[I 10:08:19.583 NotebookApp] http://localhost:8888/?token=5bee81cdc67c4c32b09029e3a0ab41c5cebfa141a6e98ba2
[I 10:08:19.583 NotebookApp]  or http://127.0.0.1:8888/?token=5bee81cdc67c4c32b09029e3a0ab41c5cebfa141a6e98ba2
[I 10:08:19.583 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:08:19.622 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/jcristia/.local/share/jupyter/runtime/nbserver-50420-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=5bee81cdc67c4c32b09029e3a0ab41c5cebfa141a6e98ba2
     or http://127.0.0.1:8888/?token=5bee81cdc67c4c32b09029e3a0ab41c5cebfa141a6e98ba2
[E 10:08:52.124 NotebookApp] Uncaught exception GET /notebooks/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2/UseOpenCV.ipynb (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2/UseOpenCV.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/tornado/web.py", line 1704, in _execute
        result = await result
      File "/usr/lib/python3.10/site-packages/tornado/gen.py", line 775, in run
        yielded = self.gen.send(value)
      File "/usr/lib/python3.10/site-packages/notebook/notebook/handlers.py", line 95, in get
        self.write(self.render_template('notebook.html',
      File "/usr/lib/python3.10/site-packages/notebook/base/handlers.py", line 516, in render_template
        return template.render(**ns)
      File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 1291, in render
        self.environment.handle_exception()
      File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 925, in handle_exception
        raise rewrite_traceback_stack(source=source)
      File "/usr/lib/python3.10/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/lib/python3.10/site-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/usr/lib/python3.10/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
        {% for exporter in get_frontend_exporters() %}
      File "/usr/lib/python3.10/site-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/usr/lib/python3.10/site-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/usr/lib/python3.10/site-packages/nbconvert/exporters/__init__.py", line 4, in <module>
        from .slides import SlidesExporter
      File "/usr/lib/python3.10/site-packages/nbconvert/exporters/slides.py", line 12, in <module>
        from ..preprocessors.base import Preprocessor
      File "/usr/lib/python3.10/site-packages/nbconvert/preprocessors/__init__.py", line 10, in <module>
        from .execute import ExecutePreprocessor
      File "/usr/lib/python3.10/site-packages/nbconvert/preprocessors/execute.py", line 8, in <module>
        from nbclient import NotebookClient, execute as _execute
    ModuleNotFoundError: No module named 'nbclient'
[E 10:08:52.132 NotebookApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "keep-alive",
      "Referer": "http://localhost:8888/tree/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2",
      "Cookie": "_xsrf=2|052750d2|1b4018654f265921b2ec6090a78fb106|1645077477; username-localhost-8888=\"2|1:0|10:1646752100|23:username-localhost-8888|44:ZjA3OWQxOTQwOTRkNGYyYTg2MmUyZmE4ZjhkM2YxMGE=|a34686528812bb2b2681cd48d6da5a28a25bbf33f9e5026e697691ba4cf6d408\"",
      "Upgrade-Insecure-Requests": "1",
      "Sec-Fetch-Dest": "document",
      "Sec-Fetch-Mode": "navigate",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-User": "?1"
    }
[E 10:08:52.132 NotebookApp] 500 GET /notebooks/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2/UseOpenCV.ipynb (127.0.0.1) 114.190000ms referer=http://localhost:8888/tree/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2
^[[B^[[B^[[A^[[AbuildingNoisybuildingNoisy^[^C[I 10:10:35.688 NotebookApp] interrupted
Serving notebooks from local directory: /home/jcristia
0 active kernels
Jupyter Notebook 6.4.8 is running at:
http://localhost:8888/?token=5bee81cdc67c4c32b09029e3a0ab41c5cebfa141a6e98ba2
 or http://127.0.0.1:8888/?token=5bee81cdc67c4c32b09029e3a0ab41c5cebfa141a6e98ba2
Shutdown this notebook server (y/[n])? ^C[C 10:10:35.784 NotebookApp] received signal 2, stopping
[I 10:10:35.784 NotebookApp] Shutting down 0 kernels
[I 10:10:35.784 NotebookApp] Shutting down 0 terminals
    ~  jupyter-notebook  --NotebookApp.use_redirect_file=False                                   ✔  2m 17s  
[I 10:11:09.809 NotebookApp] Serving notebooks from local directory: /home/jcristia
[I 10:11:09.809 NotebookApp] Jupyter Notebook 6.4.8 is running at:
[I 10:11:09.809 NotebookApp] http://localhost:8888/?token=334a14daacb723929bc6b9efbe507a6d53265b681ca302f8
[I 10:11:09.809 NotebookApp]  or http://127.0.0.1:8888/?token=334a14daacb723929bc6b9efbe507a6d53265b681ca302f8
[I 10:11:09.809 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 10:11:09.848 NotebookApp] 
    
    To access the notebook, open this file in a browser:
        file:///home/jcristia/.local/share/jupyter/runtime/nbserver-50646-open.html
    Or copy and paste one of these URLs:
        http://localhost:8888/?token=334a14daacb723929bc6b9efbe507a6d53265b681ca302f8
     or http://127.0.0.1:8888/?token=334a14daacb723929bc6b9efbe507a6d53265b681ca302f8
[E 10:11:32.949 NotebookApp] Uncaught exception GET /notebooks/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2/UseOpenCV.ipynb (127.0.0.1)
    HTTPServerRequest(protocol='http', host='localhost:8888', method='GET', uri='/notebooks/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2/UseOpenCV.ipynb', version='HTTP/1.1', remote_ip='127.0.0.1')
    Traceback (most recent call last):
      File "/usr/lib/python3.10/site-packages/tornado/web.py", line 1704, in _execute
        result = await result
      File "/usr/lib/python3.10/site-packages/tornado/gen.py", line 775, in run
        yielded = self.gen.send(value)
      File "/usr/lib/python3.10/site-packages/notebook/notebook/handlers.py", line 95, in get
        self.write(self.render_template('notebook.html',
      File "/usr/lib/python3.10/site-packages/notebook/base/handlers.py", line 516, in render_template
        return template.render(**ns)
      File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 1291, in render
        self.environment.handle_exception()
      File "/usr/lib/python3.10/site-packages/jinja2/environment.py", line 925, in handle_exception
        raise rewrite_traceback_stack(source=source)
      File "/usr/lib/python3.10/site-packages/notebook/templates/notebook.html", line 1, in top-level template code
        {% extends "page.html" %}
      File "/usr/lib/python3.10/site-packages/notebook/templates/page.html", line 154, in top-level template code
        {% block header %}
      File "/usr/lib/python3.10/site-packages/notebook/templates/notebook.html", line 115, in block 'header'
        {% for exporter in get_frontend_exporters() %}
      File "/usr/lib/python3.10/site-packages/notebook/notebook/handlers.py", line 23, in get_frontend_exporters
        from nbconvert.exporters.base import get_export_names, get_exporter
      File "/usr/lib/python3.10/site-packages/nbconvert/__init__.py", line 4, in <module>
        from .exporters import *
      File "/usr/lib/python3.10/site-packages/nbconvert/exporters/__init__.py", line 4, in <module>
        from .slides import SlidesExporter
      File "/usr/lib/python3.10/site-packages/nbconvert/exporters/slides.py", line 12, in <module>
        from ..preprocessors.base import Preprocessor
      File "/usr/lib/python3.10/site-packages/nbconvert/preprocessors/__init__.py", line 10, in <module>
        from .execute import ExecutePreprocessor
      File "/usr/lib/python3.10/site-packages/nbconvert/preprocessors/execute.py", line 8, in <module>
        from nbclient import NotebookClient, execute as _execute
    ModuleNotFoundError: No module named 'nbclient'
[E 10:11:32.955 NotebookApp] {
      "Host": "localhost:8888",
      "User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:97.0) Gecko/20100101 Firefox/97.0",
      "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8",
      "Accept-Language": "en-US,en;q=0.5",
      "Accept-Encoding": "gzip, deflate",
      "Connection": "keep-alive",
      "Referer": "http://localhost:8888/tree/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2",
      "Cookie": "_xsrf=2|052750d2|1b4018654f265921b2ec6090a78fb106|1645077477; username-localhost-8888=\"2|1:0|10:1646752270|23:username-localhost-8888|44:NmY1Mzc3YjY3ODM4NDdlYjk0ZTgyMjE0OTAzNjRkZjc=|f9d0093899cba3c3df0889d54b6743c35b4e659bafce0ecadd303c22797df236\"",
      "Upgrade-Insecure-Requests": "1",
      "Sec-Fetch-Dest": "document",
      "Sec-Fetch-Mode": "navigate",
      "Sec-Fetch-Site": "same-origin",
      "Sec-Fetch-User": "?1"
    }
[E 10:11:32.955 NotebookApp] 500 GET /notebooks/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2/UseOpenCV.ipynb (127.0.0.1) 92.560000ms referer=http://localhost:8888/tree/Insync/jcristia%40udel.edu/Google%20Drive/Spring22/ELEG404/HW2


Install jupyter-nbclient then try launching with those commands again:

sudo pacman -S jupyter-nbclient
1 Like

@jcristia I am happy that your issue is solved but AFAIK this issue wouldn’t have happened in the first place if you used pacman instead of pip because while installing jupyter-notebook with pacman, jupyter-nbclient is automatically pulled down as a dependency. This is the preferred way to install system-wide packages which also includes python packages. Please go through the links below to understand more:

Links

Best practice for install python packages [pacman vs pip]

https://unix.stackexchange.com/questions/76389/recommended-way-of-installing-python-packages-on-arch

Python - ArchWiki

1 Like

Thank you for those resources!!!

I have one more question…
I’m now using a virtual environment for my work which, after reading those links, looks like the best option for me.

How do I fix all the damage that I have done to the python environment for the system???

You can do anything with pip as long as you are in a virtual environment as that won’t affect your system at all. Alternatively you can also use pip install --user <package_name>.

I don’t think any “damage” was done here.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.