我正在为我的一个讲座做一个项目,我需要下载软件包psycopg2,以便使用postgresql数据库。不幸的是,当我试图安装psycopg2时,会弹出以下错误:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit status 1有人知道为什么会这样吗?提前感谢!
发布于 2016-09-30 22:01:18
我通过安装命令行工具修复了这个问题
xcode-select --install然后通过Homebrew安装openssl,并手动将我安装的openssl链接到pip:
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2关于macOS Sierra 10.12.1
发布于 2019-05-22 11:28:52
试着用以下方式安装:
pip install psycopg2-binary发布于 2019-08-23 07:35:44
brew install postgresql如果postgresql存在,那么运行:
brew upgrade postgresql
sudo pip install psycopg2在文中:
env LDFLAGS='-L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib' pip install psycopg2==2.8.4如果只需要使用命令pip install psycopg2导出macOSX中的路径:
export LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib"https://stackoverflow.com/questions/39767810
复制相似问题