[issue1564] sqlite3 can't import w/ OSX pypy-2.1-beta2

New submission from mike bayer <mike_mp@zzzcomputing.com>: apologies if this is known, browsing the other sqlite3 issues they seem to apply to previous versions and aren't the same thing I'm getting, this is on OSX mountain lion, pypy build linked at https://bitbucket.org/pypy/pypy/downloads/pypy-2.1-beta2-osx64.tar.bz2 classics-MacBook-Pro:src classic$ pypy-2.1-beta2-osx64/bin/pypy Python 2.7.3 (fde1203a425d, Jul 25 2013, 10:37:04) [PyPy 2.1.0-beta2 with GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.1.58)] on darwin Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: ``<fijal> I love pypy''
import sqlite3 Undefined symbols for architecture x86_64: "_sqlite3_enable_load_extension", referenced from: __cffi_f_sqlite3_enable_load_extension in _cffi__g24366574x62c16045.o (maybe you meant: __cffi_f_sqlite3_enable_load_extension) ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/src/pypy-2.1-beta2-osx64/lib-python/2.7/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/usr/local/src/pypy-2.1-beta2-osx64/lib-python/2.7/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/_sqlite3.py", line 273, in <module> """, libraries=['sqlite3'] File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/cffi/api.py", line 311, in verify lib = self.verifier.load_library() File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/cffi/verifier.py", line 68, in load_library self.compile_module() File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/cffi/verifier.py", line 56, in compile_module self._compile_module() File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/cffi/verifier.py", line 131, in _compile_module outputfilename = ffiplatform.compile(tmpdir, self.get_extension()) File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/cffi/ffiplatform.py", line 25, in compile outputfilename = _build(tmpdir, ext) File "/usr/local/src/pypy-2.1-beta2-osx64/lib_pypy/cffi/ffiplatform.py", line 50, in _build raise VerificationError('%s: %s' % (e.__class__.__name__, e)) VerificationError: LinkError: command 'gcc' failed with exit status 1
---------- messages: 5997 nosy: pypy-issue, zzzeek priority: critical release: 2.1 status: unread title: sqlite3 can't import w/ OSX pypy-2.1-beta2 ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

Alex Gaynor <alex.gaynor@gmail.com> added the comment: Ok so On my machine if I do the same it works fine, which leads me to believe the issue is related to us not bundling some needed header files. For completeness, what version of OS X do you have? ---------- nosy: +agaynor status: unread -> chatting ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

mike bayer <mike_mp@zzzcomputing.com> added the comment: this is 10.8.4. The base sqlite version is 3.7.12 in /usr, I also have 3.7.15.2 in /usr/local, I'm assuming it's using the /usr libs. ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

Alex Gaynor <alex.gaynor@gmail.com> added the comment: It's quite likely that I've messed with my paths and installed some more stuff with brew. I wonder if there's any way for us to run installations against a simulated pristine OS X. ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

Philip Jenvey <pjenvey@underboss.org> added the comment: I can't reproduce it on an older OS X (of course). So I'll just throw out some shots in the dark: Could you try nuking the __pycache__ directory inside of lib_pypy if one exists and try again? I also suggest to try removing the /usr/local version of sqlite (if it's not too much trouble) and see if that changes anything ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

mike bayer <mike_mp@zzzcomputing.com> added the comment: bleh, its just homebrew sqlite. works without it. BLEH. ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

Alex Gaynor <alex.gaynor@gmail.com> added the comment: I wonder if there's some way we can work around this. ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

mike bayer <mike_mp@zzzcomputing.com> added the comment: so if I look at my system installed python, which successfully looks only at the /usr/lib sqlite, i see this: otool -L /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so: /usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 9.6.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) then the Python that I built manually, uses the homebrew one: otool -L /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so: /usr/local/opt/sqlite/lib/libsqlite3.0.8.6.dylib (compatibility version 9.0.0, current version 9.6.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1669.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 169.3.0) somehow they're doing that. shrugs ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________

mattip <matti.picus@gmail.com> added the comment: Could setting the LIBRARY_PATH environment variable before building the sqlite3 cffi interface help? ---------- nosy: +mattip ________________________________________ PyPy bug tracker <tracker@bugs.pypy.org> <https://bugs.pypy.org/issue1564> ________________________________________
participants (4)
-
Alex Gaynor
-
mattip
-
mike bayer
-
Philip Jenvey