我正在为我的一个讲座做一个项目,我需要下载psycopg2包才能使用postgresql数据库。不幸的是,当我尝试pip install 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
有人知道为什么会这样吗?是因为Sierra不支持某些包吗?提前谢谢!
请尝试使用以下命令安装它:
我通过安装命令行工具修复了这个问题
然后通过自制安装openssl并手动将我的自制安装的openssl链接到pip:
在macOS Sierra 10.12.1上
安装/更新Xcode开发工具
查询postgres路径
安装psycopg2,使用步骤2中的路径。我的是'/usr/local/cell/postgresql/9.5.0/bin/pg_config'
相关问题 更多 >
编程相关推荐