0

Installing jupyter notebook from jupyter

Python3 version

Python 3.5.2

pip list

jupyter (1.0.0)
jupyter-client (5.2.3)
jupyter-console (5.2.0)
jupyter-core (4.4.0)

Running jupyter notebook

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 83, 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'

Also tried sudo apt-get install libsqlite3-dev from No module named _sqlite3

How to resolve the above error?

dwayneJohn
  • 919
  • 1
  • 12
  • 30

1 Answers1

1

To fix the import error for _sqlite3 I did the following:

After this python -c 'import _sqlite3' succeeded when I used the alternate installation in /usr/local/bin/python. I believe you can install Python3 from the source like this and use it.

russoue
  • 5,180
  • 5
  • 27
  • 29
  • 1
    I've encountered the same issue. Apparently pyton2.7 in Ubuntu 18.10 repositories has been built with no sqlite support – Amaksoft Jul 05 '19 at 07:13