Skip to content

python 3.6.0 is not importing sqlite3 #76301

Closed

Description

@pythonsqliteissue
BPO 32120
Nosy @berkerpeksag, @serhiy-storchaka, @python_sqlite issue
Superseder
  • bpo-29098: document minimum sqlite version
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2017-11-28.08:57:22.730>
    created_at = <Date 2017-11-23.11:14:18.989>
    labels = ['extension-modules', 'type-bug']
    title = 'python 3.6.0 is not importing sqlite3'
    updated_at = <Date 2017-11-28.08:57:22.727>
    user = 'https://github.com/pythonsqliteissue'

    bugs.python.org fields:

    activity = <Date 2017-11-28.08:57:22.727>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2017-11-28.08:57:22.730>
    closer = 'serhiy.storchaka'
    components = ['Extension Modules']
    creation = <Date 2017-11-23.11:14:18.989>
    creator = 'abinaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32120
    keywords = []
    message_count = 10.0
    messages = ['306803', '306809', '306811', '306813', '306819', '306820', '306881', '307108', '307111', '307113']
    nosy_count = 3.0
    nosy_names = ['berker.peksag', 'serhiy.storchaka', 'abinaya']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '29098'
    type = 'behavior'
    url = 'https://bugs.python.org/issue32120'
    versions = ['Python 3.6']

    Activity

    1. pythonsqliteissue commented on Nov 23, 2017

      pythonsqliteissuemannequin
      MannequinAuthor

      Hi,

      We have installed python-3.6.0 on our RedHat 6 machine.
      when we are trying to import sqlite module in python_v36 we could see below issue,

      [root@euca-10-254-72-197 rpmbuild]$ python
      Python 3.6.0 (default, Nov 23 2017, 12:46:54)
      [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
      Type "help", "copyright", "credits" or "license" for more information.

                  import sqlite3
                  Traceback (most recent call last):
                  File "", line 1, in
                  File "/opt/python/x86_64/3.6.0-1/lib/python3.6/sqlite3/init.py", line 23, in
                  from sqlite3.dbapi2 import *
                  File "/opt/python/x86_64/3.6.0-1/lib/python3.6/sqlite3/dbapi2.py", line 27, in
                  from _sqlite3 import *
                  ModuleNotFoundError: No module named '_sqlite3'

      While installing the python manually we could see below line on installation log


      Failed to build these modules:
      _hashlib _ssl

      Following modules built successfully but were removed because they could not be imported:
      _sqlite3


      It seems to be sqlite is getting broken.

      Below sqlite versions are already installed on my machine:


      [root@euca-10-254-72-197 rpmbuild]$ rpm -qa | grep sqlite
      qt-sqlite-4.6.2-28.el6_5.x86_64
      sqlite-devel-3.6.20-1.el6_7.2.x86_64
      sqlite-3.6.20-1.el6_7.2.x86_64
      libdbi-dbd-sqlite-0.8.3-5.1.el6.x86_64


      Also sqlite3 seems to be working fine without any issue on python2.
      Can anyone please help me on this.

      Regards,
      Abinaya

    2. added
      type-crashA hard crash of the interpreter, possibly with a core dump
      buildThe build process and cross-build
      on Nov 23, 2017
    3. berkerpeksag commented on Nov 23, 2017

      @berkerpeksag
      Member

      3.6.0 was required sqlite 3.7.4 but the requirement was lifted in Python 3.6.1. 3.6.3 is the latest release of Python 3.6. Please try Python 3.6.3.

      Also, this is a duplicate of bpo-29098.

    4. added and removed
      buildThe build process and cross-build
      on Nov 23, 2017
    5. added
      type-bugAn unexpected behavior, bug, or error
      and removed
      type-crashA hard crash of the interpreter, possibly with a core dump
      on Nov 23, 2017
    6. pythonsqliteissue commented on Nov 23, 2017

      pythonsqliteissuemannequin
      MannequinAuthor

      Thanks for the update.

      Could you please let me know if we build latest python_v363 then sqlite will be work right.

    7. berkerpeksag commented on Nov 23, 2017

      @berkerpeksag
      Member

      Could you please let me know if we build latest python_v363 then sqlite
      will be work right.

      It should build fine with Python 3.6.3. Let us know if you can't get it working.

    8. pythonsqliteissue commented on Nov 23, 2017

      pythonsqliteissuemannequin
      MannequinAuthor

      Thanks for the help.

      If we import pysqlite2 I could see the error that pysqlite2 module not found.
      Please let us know is there anyway to get pysqlite2 in python_v363.

    9. berkerpeksag commented on Nov 23, 2017

      @berkerpeksag
      Member

      pysqlite2 only works in Python 2: https://github.com/ghaering/pysqlite/blob/e728ffbcaeb7bfae1d6b7165369bd0ae16cabf95/setup.py#L25-L28

      You don't need to install pysqlite2 in Python 3. The latest release of Python 3.6 (which is 3.6.3, not 3.6.0) should work fine with sqlite3 3.6.20.

    10. pythonsqliteissue commented on Nov 24, 2017

      pythonsqliteissuemannequin
      MannequinAuthor

      Is there any bug in python_v360.
      Please let me know why its not supporting sqlite3.

      Python-3.6.3 seems to working but It would be better if you give some clarification about python3.6.0.

    11. pythonsqliteissue commented on Nov 28, 2017

      pythonsqliteissuemannequin
      MannequinAuthor

      Sorry to re-open.

      Please anyone let me know why python 3.6.0 not supporting sqlite3.
      our customers request to give the clarification.
      i have tried a lot and spend more time on this but i couldn't get the exact reason.

    12. pythonsqliteissue commented on Nov 28, 2017

      pythonsqliteissuemannequin
      MannequinAuthor

      *** WARNING: renaming "_sqlite3" since importing it failed: build/lib.linux-x86_64-3.6/_sqlite3.cpython-36m-x86_64-linux-gnu.so: undefined symbol: sqlite3_stmt_readonly

      Python build finished successfully!
      The necessary bits to build these optional modules were not found:
      _lzma
      To find the necessary bits, look in setup.py in detect_modules() for the module's name.

      The following modules found by detect_modules() in setup.py, have been
      built by the Makefile instead, as configured by the Setup files:
      atexit pwd time

      Failed to build these modules:
      _hashlib _ssl

      Following modules built successfully but were removed because they could not be imported:
      _sqlite3

      > Above issue is the one which we could see while building the python 3.6.0.

    13. serhiy-storchaka commented on Nov 28, 2017

      @serhiy-storchaka
      Member

      This issue already has been fixed. Try Python 3.6.3.

    14. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      extension-modulesC modules in the Modules dirtype-bugAn unexpected behavior, bug, or error

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions