sqlite in 2.7 on redhat 6

Larry Martell larry.martell at gmail.com
Thu Jun 15 09:29:36 EDT 2017


On Thu, Jun 15, 2017 at 8:56 AM, Mark Summerfield via Python-list
<python-list at python.org> wrote:
> 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

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 28, in <module>
    from _sqlite3 import *
ImportError: No module named _sqlite3



More information about the Python-list mailing list