【发布时间】:2017-06-19 01:34:58
【问题描述】:
症状:在我的 Django 应用程序中,当我调用 from pysqlite2._sqlite import * 时,我得到了回溯 Symbol not found: _sqlite3_enable_load_extension
背景:
- 我使用 homebrew (python 2.7.13) 安装了 python,它自动安装了 sqlite
- 我正在使用命令行工具 macOS 10.12、Xcode 8.2.1 运行 macOS 10.12.3
- 我已经使用 pip (pysqlite 2.8.3) 安装了 pysqlite
我试过了
-
brew uninstall sqlite和brew uninstall python并重新安装 -
将这些添加到我的 .bash_profile
export PATH="$(brew --prefix sqlite)/bin:$PATH" LDFLAGS="-L/usr/local/opt/sqlite/lib" CPPFLAGS="-I/usr/local/opt/sqlite/include" export PKG_CONFIG_PATH=“/usr/local/opt/sqlite/lib/pkgconfig” python -c "import sqlite3" 不返回任何错误
回溯要点:https://gist.github.com/xwchen/e9704fa34f0463d2117fe9fbb37922a1
【问题讨论】:
-
我现在有同样的
Symbol not found: _sqlite3_enable_load_extension错误。我重新安装了 python2、python3 和 sqlite,但没有成功,我再也找不到对我有帮助的谷歌页面了。我还添加了几个环境变量。像LDFLAGS、CPPFLAGS、PKG_CONFIG_PATH、DYLD_LIBRARY_PATH我在
标签: python sqlite homebrew pysqlite