r/learnpython • u/CosmicRupee • Nov 01 '26
no module sqlite
Hi i’m in python trying to learn . I have the SQlite extension but it’s telling me no module name found sqlite . when trying to run the is line
import sqlite
i’ve also tried import sqlite3
1
Upvotes
4
u/atarivcs Nov 01 '26
The actual module name is sqlite3, not sqlite
Also, sqlite3 is is built in to python, so I'm not sure what you mean by "SQlite extension". You shouldn't need any extension.
11
u/patryk_builds Nov 01 '26
The right one is `import sqlite3`, it's built into python so there's nothing to install. the SQLite extension you installed is just for your editor (viewing .db files), python doesn't use it at all.
If `import sqlite3` also fails, it's usually one of these:
- you named your own file sqlite3.py, so python imports your file instead. rename it and delete any __pycache__ folder next to it
- your editor is running a different python than you think. run `import sys; print(sys.executable)` to see which one
- on linux, python built from source sometimes misses it, then you need `sudo apt install libsqlite3-dev` and reinstall python
What's the exact error you get with sqlite3?
0
u/CosmicRupee Nov 01 '26
i’m usually vs code