Issue39410
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2020-01-21 12:53 by cehovski, last changed 2022-04-11 14:59 by admin. This issue is now closed.
Messages (5) | |||
---|---|---|---|
msg360395 - (view) | Author: Igor Ceh (cehovski) | Date: 2020-01-21 12:53 | |
While trying to build Python 3.8.1 from source with Sqlite 3.30.1 on a CentOS 6.10 I get the following warning: *** WARNING: renaming "_sqlite3" since importing it failed: build/lib.linux-x86_64-3.8/_sqlite3.cpython-38-x86_64-linux-gnu.so: undefined symbol: sqlite3_close_v2 The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Failed to build these modules: _uuid Following modules built successfully but were removed because they could not be imported: _sqlite3 If I try to import sqlite in python: [vagrant@centos6 Python-3.8.1]$ ./python Python 3.8.1 (default, Jan 21 2020, 04:22:59) [GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux 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/src/Python-3.8.1/Lib/sqlite3/__init__.py", line 23, in <module> from sqlite3.dbapi2 import * File "/usr/local/src/Python-3.8.1/Lib/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ModuleNotFoundError: No module named '_sqlite3' >>> Also tried building with SQLite version 3.7.9 from atomic repository with same error. |
|||
msg360400 - (view) | Author: Igor Ceh (cehovski) | Date: 2020-01-21 14:30 | |
I've changed ./Modules/_sqlite/util.h //#if SQLITE_VERSION_NUMBER >= 3007014 #if SQLITE_VERSION_NUMBER >= 3107014 // Change #define SQLITE3_CLOSE sqlite3_close_v2 #else #define SQLITE3_CLOSE sqlite3_close #endif #endif And tried to recompile with a new error: *** WARNING: renaming "_sqlite3" since importing it failed: build/lib.linux-x86_64-3.8/_sqlite3.cpython-38-x86_64-linux-gnu.so: undefined symbol: sqlite3_errstr The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Failed to build these modules: _uuid Following modules built successfully but were removed because they could not be imported: _sqlite3 Went into ./Modules/_sqlite/connection.c and also changed: //#if SQLITE_VERSION_NUMBER > 3007015 #if SQLITE_VERSION_NUMBER > 3107015 // Change PyErr_SetString(pysqlite_OperationalError, sqlite3_errstr(rc)); With these changes the build was successful and I can import sqlite3. But I have no idea if this has any unforeseen consequences. |
|||
msg364737 - (view) | Author: Joshua Y (Joshua Y) | Date: 2020-03-21 11:11 | |
I am hitting a possibly related issue. System is running Centos6.9 and SQLite 3.10.0. Python 3.8.2 built successfully (using pyenv / python-build), and I can import the sqlite3 lib with seemingly no issue... % python3 Python 3.8.2 (default, Mar 21 2020, 20:15:25) [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 >>> from sqlite3.dbapi2 import * >>> from _sqlite3 import * >>> However, after I installed and ran jupyterhub, and attempted to log in, I hit the same 'undefined symbol' error [I 2020-03-21 21:42:52.465 JupyterHub spawner:1417] Spawning jupyterhub-singleuser --port=38433 Traceback (most recent call last): File "/opt/pyenv/versions/3.8.2/lib/python3.8/site-packages/notebook/services/sessions/sessionmanager.py", line 9, in <module> import sqlite3 File "/opt/pyenv/versions/3.8.2/lib/python3.8/sqlite3/__init__.py", line 23, in <module> from sqlite3.dbapi2 import * File "/opt/pyenv/versions/3.8.2/lib/python3.8/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ImportError: /opt/pyenv/versions/3.8.2/lib/python3.8/lib-dynload/_sqlite3.cpython-38-x86_64-linux-gnu.so: undefined symbol: sqlite3_close_v2 |
|||
msg364782 - (view) | Author: Joshua Y (Joshua Y) | Date: 2020-03-22 04:59 | |
It always a good idea to sleep on these things before I comment. Because I compiled SQLite3 under prefix /usr/local, I rebuilt Python 3.8.2 with `-L /usr/local/lib64` added to my LDFLAGS and now things are working fine (so far). |
|||
msg404287 - (view) | Author: Erlend E. Aasland (erlendaasland) * | Date: 2021-10-19 10:51 | |
If you are building CPython against a specific version of SQLite (for example one you've compiled yourself), make sure that you adjust _both_ CFLAGS and LDFLAGS. Note: since bpo-40810 / GH-24106, SQLite 3.7.15 or newer is required. Closing this as not-a-bug. Please reopen if you disagree. |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:59:25 | admin | set | github: 83591 |
2021-10-19 10:51:56 | erlendaasland | set | status: open -> closed nosy: + erlendaasland messages: + msg404287 resolution: not a bug stage: resolved |
2020-03-22 04:59:04 | Joshua Y | set | messages: + msg364782 |
2020-03-21 11:11:04 | Joshua Y | set | nosy:
+ Joshua Y messages: + msg364737 |
2020-01-21 17:04:43 | SilentGhost | set | nosy:
+ ghaering components: + Library (Lib) versions: + Python 3.9 |
2020-01-21 14:30:18 | cehovski | set | messages: + msg360400 |
2020-01-21 12:53:42 | cehovski | create |