Jupyter missing _sqlite3 and pysqlite2

Suppenkasper picture Suppenkasper · Aug 8, 2017 · Viewed 7.7k times · Source

trying to get jupyter (ipython3) running on Python3.5, I installed it using

sudo pip3 install jupyter

However, when trying to launch jupyter notebook I receive the error that the modules _sqlite3 and pysqlite2 are missing. I tried installing them via pip3. For pysqlite2 there seems to be no version availabel (?). For sqlite3 I get

RuntimeError: Package 'sqlite3' must not be downloaded from pypi

Traceback (most recent call last):   File "/usr/local/lib/python3.5/site-packages/notebook/services/sessions/sessionmanager.py", line 10, in <module>
    import sqlite3   File "/usr/local/lib/python3.5/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *   File "/usr/local/lib/python3.5/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import * ImportError: No module named '_sqlite3'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/bin/jupyter-notebook", line 7, in <module>
    from notebook.notebookapp import main
  File "/usr/local/lib/python3.5/site-packages/notebook/notebookapp.py", line 79, in <module>
    from .services.sessions.sessionmanager import SessionManager
  File "/usr/local/lib/python3.5/site-packages/notebook/services/sessions/sessionmanager.py", line 13, in <module>
    from pysqlite2 import dbapi2 as sqlite3
ImportError: No module named 'pysqlite2'

Any ideas?

Answer

Suppenkasper picture Suppenkasper · Aug 8, 2017

I was missing libsqlite3-dev when building Python3. So after running sudo apt-get install libsqlite3-dev and rebuilding Python3 everything seems to work now.