Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing sqlite3 after Python3 compile

My question is much like several others. Having manually compiled Python, sqlite3 is missing:

enter image description here

The main difference is that I'm using a Debian Linux system (unlike in this question: OS X 10.8.2 python 3 import sqlite error), and Python3 (unlike in this and a bunch of other questions: Cannot import SQLite with Python 2.6).

I was hoping for some guidance on which direction to troubleshoot in. According to some of the Linux-but-older-Python questions, an error like the one I'm getting could be caused by a missing resource during linking or something (_sqlite3.so). I have two such files on my system, both of them in older Python installations, ... but nothing related to Python3. Or is one of these good enough? Or they say to install the libsqlite3-dev package, then to re-compile Python. I did this, but I don't see how just having this package on my system will affect the compilation process. And indeed, it didn't. A second compile gave me a second Python without sqlite3.

I wish I could just do apt-get install python3, but Debian, in its stability, only has Python 3.2, where I need the latest version. Thoughts?

like image 392
Brian Peterson Avatar asked Sep 11 '13 20:09

Brian Peterson


People also ask

Does python3 come with SQLite?

SQLite is a self-contained, file-based SQL database. SQLite comes bundled with Python and can be used in any of your Python applications without having to install any additional software. In this tutorial, we'll go through the sqlite3 module in Python 3.


1 Answers

You need to install libsqlite3 (Debian based) or sqlite-devel (RedHat based) and the associated header files before compiling Python because Python needs to find them during the compile process.

Did you make sure to run:

  1. ./configure
  2. make
  3. make install

In this specific order? With no missing steps?

like image 200
Thomas Orozco Avatar answered Sep 24 '22 09:09

Thomas Orozco