Sqlite3 python2.7 and Ubuntu 10.04 (or just python2.6)

Question: How can I get non-system Python2.7 to search for sqlite3 libraries?

More details:

I am running Ubuntu 10.04 LTS that uses Python2.6.

I have projects that require Python2.7. I use the flags -python = Python2.7 for virtualenv to use my project.

I have the following sqlite3 stuff installed

libsqlite3-0 - SQLite 3 shared library
libsqlite3-dev - SQLite 3 development files
sqlite3 - Command line interface for SQLite 3

I can import and use sqlite3 with Python2.6. But not so lucky with Python2.7.

Python 2.7.2 (default, Sep 18 2011, 19:55:45) [GCC 4.4.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ImportError: No module named _sqlite3 

This is how I got Python2.7 on a machine

tar xzf Python-2.7.tgz cd Python-2.7. / configure do sudo make altinstall enter code here

+4
source share
1 answer

Re-compiling python2.7 did the trick.

0
source

All Articles