Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linking issue on centos 6 #85

Closed
jamespo opened this issue Sep 4, 2015 · 6 comments
Closed

linking issue on centos 6 #85

jamespo opened this issue Sep 4, 2015 · 6 comments

Comments

@jamespo
Copy link

jamespo commented Sep 4, 2015

Centos 6 comes with SQLite 3.6.20

Installing latest pysqlite on python 2.7 gives the below error when attempting to use this module.

/python2.7/site-packages/pysqlite2/_sqlite.so: undefined symbol: sqlite3_stmt_readonly

It seems like sqlite3_stmt_readonly was only supplied with SQLite 3.7+, are there any workarounds for this?

@ghaering
Copy link
Owner

ghaering commented Sep 4, 2015

A possible workaround is to statically link against the SQLite amalgamation. Download the SQLite amalgamation from https://sqlite.org/download.html, then from the archive, put the files into the pysqlite root directory and build pysqlite with:

python setup.py build_static

@ghaering ghaering closed this as completed Sep 7, 2015
@peterjc
Copy link

peterjc commented Dec 7, 2016

Would the same solution apply in principle if compiling Python from source on CentOS 6, or should I file an issue with Python instead?

e.g. trying Python 3.6 rc1,

$ wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0rc1.tgz
$ tar -zxvf Python-3.6.0rc1.tgz 
$ cd Python-3.6.0rc1
$  ./configure --prefix=$HOME
$ make
...
*** 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
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               

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

@berkerpeksag
Copy link

Python doesn't support the amalgamation version. You'll need to update your system sqlite version. But we probably can add a --with-sqlite=PATH configuration option similar to http://bugs.python.org/issue21541

@EricDeveaud
Copy link

+1 for the --with-sqlite=PATH

it would be nice to have some build flags that can point to the correct sqlite library
that will aloow us to install sqlite in a non standard directory and link versus this one instead of the system one.

@scopion
Copy link

scopion commented May 5, 2017

i am installing the mhn in centos6.9 when i get the problem. i did some search. and soleved it with the follow two commands.
cp /usr/lib64/python2.6/lib-dynload/_sqlite3.so /usr/local/lib/python2.7/sqlite3/
cp /usr/lib64/python2.6/lib-dynload/_sqlite3.so /usr/local/lib/python2.7/lib-dynload/

@rustberry
Copy link

@scopion 's method worked like a charm for me. Cenos 6 is a pitty because its package manager is said to be bound up to Python 2.6. I compiled Py 2.7.14 from source code following the link above. Hope this would help people dow the line. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants