繁体   English   中英

无法使用 EDB 的交互式安装程序在 Mac 上安装 psycopg2

[英]Unable to install psycopg2 on mac using Interactive installer by EDB

问题陈述

大家好,我正在尝试在我的 Mac OS 上安装 psycopg2 以将 PostGreSQL 14 与 Python-Django 集成。

我通过此链接上的 EBD 安装了 PostGreSQL 14 。

当我在终端上运行时,下面的命令:

pip3 install psycopg2

我收到错误Error: pg_config executable not found.

尝试的解决方案没有成功

这似乎是互联网上常见且有据可查的错误。 到目前为止,以下解决方案都没有对我有用:

  • 1 pip3 install psycopg2-binary

     Error: missing pg_config
  • 2 which pg_config

     Error: pg_config not found
  • 3 pip3 install --upgrade wheel然后'pip3 install psycopg2-binary'

     Error: pg_config executable not found.
  • 4 brew install postgresql

     Error: zsh: command not found: brew

解决

我需要安装HomeBrew ,然后运行

export PATH=/opt/homebrew/bin:$PATH


brew install postgresql

pip3 install psycopg2

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM