1

I have Python 2.7.6 and Python 3.3.4 installed through homebrew. I ran into some errors when trying to use Sqlite and I traced the error to a "symbol not found" error. Please see the trace below.

How can I get this thing to work?

>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: dlopen(/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so, 2): Symbol not found: _sqlite3_enable_load_extension
  Referenced from: /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so
  Expected in: /usr/lib/libsqlite3.dylib
 in /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_sqlite3.so

edit: Sqlite3 also seems to be properly installed (sqlite-3.8.3 already installed).

On a sidenote, why does homebrew stick with Python 2.7.6 while the Python website offers version 2.7.8 for download?

3
  • 1
    You probably want to update your brew; 2.7.8 is already there, since July 2nd. Run brew update. Commented Oct 5, 2014 at 21:17
  • I am able to use Sqlite by installing the alternative PySQLite(2) package through pip. This is still just a workaround and the issue with the standard library "sqlite3" remains. Commented Oct 5, 2014 at 21:17
  • @MartijnPieters That actually did the trick. I was unaware that brew itself had to be up-to-date first to make use of upgraded "formulae". Commented Oct 5, 2014 at 21:20

1 Answer 1

1

You need to run brew update; both the sqlite formula and the python formula have seen numerous updates.

Python 2.7.8 has been available since July 2nd, for example. Your SQLite problems have probably long been solved with updates as well.

It is always a good idea to run brew doctor when you are having problems with Homebrew-supplied software; the output would have told you to run brew update too:

$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.