【问题标题】:Can't install psycopg2 in mac os with pip [duplicate]无法使用 pip 在 mac os 中安装 psycopg2 [重复]
【发布时间】:2017-03-11 17:58:33
【问题描述】:

我正在尝试使用 pip 将 psycopg2 安装到 virtualenv 并收到以下错误:

ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'cc' failed with exit status 1

尝试 google lssl 库的 python 并且找不到任何提及此错误的内容。我做错了吗?

pip 8.1.2
python 2.7.10
virtualenv 12.0.7
macos 10.12.1 

更新:实际上看起来这个问题是这个问题的副本:Can't install psycopg2 package through pip install... Is this because of Sierra? 该问题的解决方案帮助了我。问题在于缺少 xcode-cli 工具,xcode-select --install 解决了我的问题。

【问题讨论】:

  • 尝试安装openssl。我怀疑这会清除它。
  • @DejaVuSansMono 尝试了pip install pyopenssl。没有变化。

标签: python macos


【解决方案1】:

所以实际上这个问题是这个问题的重复:Can't install psycopg2 package through pip install... Is this because of Sierra?

就我而言,xcode-select --install 解决了这个问题。我想我遇到了这个问题,因为我将我的 Xcode 更新到了昨天发布的新版本。

【讨论】: