2

I have installed anaconda in mac os sierra. Simple python scripts run fine. However, when I try to run jupyter-notebook it fails.

The error message is following:

Traceback (most recent call last):
  File "/Users/poudel/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 10, in <module>
    import sqlite3
  File "/Users/poudel/anaconda3/lib/python3.6/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/Users/poudel/anaconda3/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: dlopen(/Users/poudel/anaconda3/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-darwin.so, 2): Symbol not found: _sqlite3_enable_load_extension
  Referenced from: /Users/poudel/anaconda3/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-darwin.so
  Expected in: /usr/lib/libsqlite3.dylib
 in /Users/poudel/anaconda3/lib/python3.6/lib-dynload/_sqlite3.cpython-36m-darwin.so

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/poudel/anaconda3/bin/jupyter-notebook", line 7, in <module>
    from notebook.notebookapp import main
  File "/Users/poudel/anaconda3/lib/python3.6/site-packages/notebook/notebookapp.py", line 79, in <module>
    from .services.sessions.sessionmanager import SessionManager
  File "/Users/poudel/anaconda3/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 13, in <module>
    from pysqlite2 import dbapi2 as sqlite3
ModuleNotFoundError: No module named 'pysqlite2'

I checked the dylib file, but it is there. What's wrong here?

Bhishan:ls /usr/lib/libsqlite3.dylib 
/usr/lib/libsqlite3.dylib*

Similar problems:

No module named _sqlite3

But they did not solve my problem.

2 Answers2

0

Your problem is most likely due to several python envirionments. Check this question. Also this question maybe relevant.

Also try to see all installed packages with conda.

queezz
  • 1,832
  • 2
  • 20
  • 26
0

I have faced the same issue.

For me installing sqlite via brew solved the issue.

brew install sqlite
Martin Brisiak
  • 3,872
  • 12
  • 37
  • 51