• Register
0 votes
75 views

Problem:

how to I Solve  this: modulenotfounderror: no module named '_sqlite3'

HELP! I need help understanding this: modulenotfounderror: no module named '_sqlite3'

Can someone please help solve this, I am new in python().

Someone have idea to solve this thanks!

 

13k points

Please log in or register to answer this question.

1 Answer

0 votes

Solution:

It appears your makefile did not encompass the appropriate .so document. You can accurate this trouble with the stairs below:

Install sqlite-devel (or libsqlite3-dev on a few Debian-primarily based totally systems)

Re-configure and re-compiled Python with ./configure --enable-loadable-sqlite-extensions && make && sudo make set up

Note

The sudo make set up component will set that python model to be the system-huge standard, that could have unforseen consequences. If you run this command to your workstation, you may probable need to have it established alongside the prevailing python, which may be carried out with sudo make altinstall.

I had the identical trouble (building python2.five from supply on Ubuntu Lucid), and import sqlite3 threw this identical exception. I've established libsqlite3-dev from the package deal manager, recompiled python2.five, after which the import worked.

I had the identical trouble with Python 3.five on Ubuntu whilst using pyenv.

If you are putting in the python using pyenv, it is indeed as one in all the not unusualplace construct problems. To remedy it, put off the established python model, set up the requirements (for this precise case libsqlite3-dev), then reinstall the python model.

My _sqlite3.so is in /usr/lib/python2.five/lib-dynload/_sqlite3.so. Judging out of your paths, you need to have the document /usr/local/lib/python2.five/lib-dynload/_sqlite3.so.

Try the following:

find /usr/local -call _sqlite3.so

If the document is not found, some thing can be incorrect together along with your Python installation. If it is, ensure the course it is established to is withinside the Python course. In the Python shell,

import sys

print sys.course

After strolling make I did now no longer get any warnings pronouncing the sqlite guide became now no longer constructed (i.e., it constructed correctly :P ), however after strolling make set up, sqlite3 nevertheless did now no longer import with the identical "ImportError: No module named _sqlite3" whe strolling "import sqlite3".

24.2k points