Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using brew installed sqlite3

I want to use sqlite with the json extension so I've installed it with homebrew. When I run which sqlite though, the one that is being used is the anaconda install. If I try and use pythons sqlite library I have the same issue. It's linked to the Anaconda version and the JSON functions aren't available. How do I replace this with the brew version? Brew provided some values when I installed sqlite but I don't know if I need them or how they are used.

LDFLAGS: -L/usr/local/opt/sqlite/lib CPPFLAGS: -I/usr/local/opt/sqlite/include PKG_CONFIG_PATH: /usr/local/opt/sqlite/lib/pkgconfig

like image 283
Marcus Avatar asked Dec 28 '16 20:12

Marcus


1 Answers

Sqlite installed by Homebrew is keg-only, which is not linked to /usr/local/... .
This is because system already have older version of sqlite3.

If you really want to invoke Homebrew's sqlite binary, specify full path as below.

$ /usr/local/opt/sqlite/bin/sqlite3

(All Homebrew package is symlinked under /usr/local/opt)

I'm not so familiar with python, but AFAIK sqlite is statically linked to python executable.
In other words, maybe you have to build python from source to use with Homebrew's sqlite.

like image 153
equal-l2 Avatar answered Oct 21 '22 03:10

equal-l2