如何在Mac上安装psycopg2(pg_config可执行文件未找到错误)



我正在学习如何将Postgres与Python一起使用(sqlalchemy)。我在安装 psycopg2 时卡住了.我有以下错误:

pg_config executable not found error

我知道这是一个非常常见的错误,并且已经有很多答案,但我找不到任何可以帮助我解决问题的东西。

我特别不明白这个答案:

将 Postgres 的路径添加到您的 .profile 文件中,方法是附加 以后:

PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"

这是什么意思?我应该怎么做?

我也试图在我的终端中输入which -a pg_config,但没有任何反应。

多谢!

问题已通过键入解决

PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"

在安装 psycopg2 之前进入终端窗口。

最新更新