sqlite in 2.7 on redhat 6

Mark Summerfield m.n.summerfield at googlemail.com
Thu Jun 15 08:56:05 EDT 2017


On Thursday, June 15, 2017 at 1:47:00 PM UTC+1, Larry.... at gmail.com wrote:
> I am trying to use sqlite
> 
> $ python2.7
> Python 2.7.10 (default, Feb 22 2016, 12:13:36)
> [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import _sqlite3
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: No module named _sqlite3
> 
> It's there at: /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/_sqlite3.so
> but that is not in my path.
> 
> I tried adding /opt/rh/python27/root/usr/lib64/python2.7/lib-dynload/
> to my path and then it fails with:
> 
> ImportError: libpython2.7.so.1.0: cannot open shared object file: No
> such file or directory
> 
> Isn't sqlite part of the standard lib? Shouldn't this just work?

Try:

>>> import sqlite3 # no leading underscore



More information about the Python-list mailing list