无法通过pip install安装psycopg2软件包...这是因为Sierra吗? [英] Can't install psycopg2 package through pip install... Is this because of Sierra?

查看:169
本文介绍了无法通过pip install安装psycopg2软件包...这是因为Sierra吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为一个讲座做一个项目,我需要下载软件包psycopg2才能使用正在使用的postgresql数据库.不幸的是,当我尝试点子安装psycopg2时,会弹出以下错误:

I am working on a project for one of my lectures and I need to download the package psycopg2 in order to work with the postgresql database in use. Unfortunately, when I try to pip install psycopg2 the following error pops up:

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不支持某些软件包吗?预先感谢!

Does anyone know why this is happening? Is it because Sierra has not supported some packages? Thanks in advance!

推荐答案

我通过安装命令行工具解决了该问题

I fixed this by installing Command Line Tools

xcode-select --install

然后通过Homebrew安装openssl并手动将安装了homebrew的openssl链接到pip:

then installing openssl via Homebrew and manually linking my homebrew-installed openssl to pip:

env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install psycopg2

在macOS Sierra 10.12.1上

on macOS Sierra 10.12.1

这篇关于无法通过pip install安装psycopg2软件包...这是因为Sierra吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆