When starting jupyter notebook, an exception is reported: ModuleNotFoundError: No module named'pysqlite2'

Today is about to talk about the scientific computing course. Let the class leader inform the class students in advance to install some computing libraries and preview them for use. Unexpectedly, various problems emerge in endlessly:

problem:

ModuleNotFoundError: No module named'pysqlite2'
Analysis reason: /home/python/.virtualenvs/ai/lib/python3.7/site-packages/notebook/services/sessions/sessionmanager.py There is such a line of code in the file: from pysqlite2 import dbapi2 as sqlite3
but pysqlite2 cannot be retrieved.

solution:

The first step: install pysqlite3 the
Insert picture description here
second step:
2.1 switch to the specified file;
2.2 find sessionmanager.py
2.3 use the vim editor to edit the from pysqlite2 import dbapi2 as sqlite3 line in the sessionmanager.py package code, change pysqlite2 to pysqlite3 Can
Insert picture description here

The third part: start jupyter notebook successfully, go and try.
Insert picture description here
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41475067/article/details/112613775