sqlite in 2.7 on redhat 6

Thomas Jollans tjol at tjol.eu
Fri Jun 16 14:16:24 EDT 2017


On 15/06/17 14:45, Larry Martell 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

This looks like it's installed for an SCL
(https://www.softwarecollections.org/en/scls/rhscl/python27/). Are you
running the SCL python, or some other python?

You either have to run the SCL python (My guess without having an EL6
system lying around: scl enable python27) or install sqlite in whatever
python installation you're actually using.

.
> 
> 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?
> 




More information about the Python-list mailing list