blue-yonder / turbodbc

Turbodbc is a Python module to access relational databases via the Open Database Connectivity (ODBC) interface. The module complies with the Python Database API Specification 2.0.
http://turbodbc.readthedocs.io/en/latest
MIT License
607 stars 85 forks source link

4..5.10 produces ImportError with pyarrow-11.0.0 and Python 3.10 on Linux-x86_64 #384

Open jmao-denver opened 1 year ago

jmao-denver commented 1 year ago
root@87a6a5c218dc:/python# python
Python 3.10.6 (main, Nov 14 2022, 16:10:14) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import turbodbc
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/deephaven/venv/lib/python3.10/site-packages/turbodbc/__init__.py", line 2, in <module>
    from turbodbc_intern import Megabytes, Rows
ImportError: /opt/deephaven/venv/lib/python3.10/site-packages/turbodbc_intern.cpython-310-x86_64-linux-gnu.so: undefined symbol: _ZN8turbodbc6cursor7prepareERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
>>> quit()
root@87a6a5c218dc:/python# pip list
Package                Version
---------------------- --------
adbc-driver-manager    0.2.0
adbc-driver-postgresql 0.2.0
deephaven-core         0.22.0
deephaven-plugin       0.3.0
java-utilities         0.2.0
jedi                   0.18.2
jpy                    0.13.0
llvmlite               0.39.1
numba                  0.56.4
numpy                  1.23.5
pandas                 1.5.3
parso                  0.8.3
pip                    23.0.1
pyarrow                11.0.0
python-dateutil        2.8.2
pytz                   2022.7.1
setuptools             67.4.0
six                    1.16.0
turbodbc               4.5.10
unittest-xml-reporting 3.0.4
wheel                  0.38.4
harleybl commented 1 year ago

I also have the same issue using turbodbc 4.5.10 on Python 3.10 under Ubuntu 20.04. I installed all the prerequisites correctly. Any ideas on how to troubleshoot or fix this?

jmao-denver commented 1 year ago

Sorry I was too busy and forgot to post the workaround:

CFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0" pip install turbodbc

Let me know if it doesn't work for you.

harleybl commented 1 year ago

Thanks for the quick response. - Dumb question - will those flags work with Poetry?

jmao-denver commented 1 year ago

Never used poetry but I don't see why not. If you install other C/C++ extension packages from source distributions, then be careful and limit the use of it to installing turbodbc only.