ContinuumIO / anaconda-issues

Anaconda issue tracking
648 stars 223 forks source link

pyodbc w/ SQLite3 driver crashes Anaconda Python #551

Open esamanas opened 8 years ago

esamanas commented 8 years ago

I am on Ubuntu 14.04. I have the sqlite3odbc driver (v0.992-2) installed in the UnixODBC Driver Manager (v2.2.14), both packages installed from apt-get, and pyodbc (v3.0.10) installed with pip in a conda (v3.14.1) environment. This code results in a crash with this output:

(evan-default)evan@lasarti:~$ ipython
Python 2.7.10 |Continuum Analytics, Inc.| (default, Sep 15 2015, 14:50:01)
Type "copyright", "credits" or "license" for more information.

IPython 3.2.1 -- An enhanced Interactive Python.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: import pyodbc

In [2]: db = pyodbc.connect("Driver=SQLite3Local;Database=/path/to/sqlite.db")

In [3]: cursor = db.cursor()

In [4]: cursor.execute("SELECT * FROM test")
/home/evan/anaconda/envs/evan-default/bin/python: symbol lookup error: /home/evan/local/lib/libsqlite3odbc.so: undefined symbol: sqlite3_column_table_name

It appears to be due to the conda packaged libsqlite3.so being compiled without SQLITE_ENABLE_COLUMN_METADATA enabled. I was able to verify that the crash didn't happen using Ubuntu's system-installed Python, and also when I compiled libsqliteodbc from source with this configure line: ./configure --with-sqlite3=/home/evan/anaconda/envs/evan-default. So the ODBC driver is able to work without "sqlite3_column_table_name"...it just isn't compiled like that by default on Ubuntu 14.04.

pbc commented 8 years ago

I've just stumbled on this when compiling latest opencv binaries and it's python bindings under python 3.5.2 and 3.4.5

Any idea how to fix this or work around it ?

seisman commented 6 years ago

Any updates on this issue?

mingwandroid commented 6 years ago

From reading: https://sqlite.org/compile.html it seems SQLITE_ENABLE_COLUMN_METADATA is an option that is normally turned off, I expect there may be a good reason not to turn this option on, otherwise upstream wouldn't turn it off by default.

We need to look into this carefully.

cipri-tom commented 6 years ago

@pbc exactly the same problem here. I installed openCV and I get /usr/lib/libgdal.so.1: undefined symbol: sqlite3_column_table_name when trying to use it from a conda python. It works if I use the systemwide python3.

Any solutions? Does conda change the library path or something ?