python - “pip install psycopg2”在 Linux 上不起作用(找不到 pg_config 可执行文件)
问题描述
尝试使用以下命令在 Linux 上安装 psycopg2 软件包: pip install psycopg2
收到以下错误:
错误:找不到 pg_config 可执行文件。
pg_config is required to build psycopg2 from source. Please add the directory
containing pg_config to the $PATH or specify the full executable path with the
option:
python setup.py build_ext --pg-config /path/to/pg_config build
运行“python setup.py build_ext --pg-config /path/to/pg_config build”后,
我收到以下错误:
“python:无法打开文件'setup.py':[Errno 2]没有这样的文件或目录”
有人可以解释我如何将包含 pg_config 的目录添加到 $PATH 吗?
另外,我在 virtualenv 中执行所有这些命令。
解决方案
推荐阅读
- node.js - 量角器:MicrosoftEdge 驱动程序:错误:错误:服务器提前终止,状态为 1
- r - 通过向量分配多列而不回收
- regex - 匹配字符串中前面有品牌的型号名称
- javascript - Vizframe UI5 饼图 Odata 绑定问题
- ios - 输入时间时显示键盘而不是仅旋转,iOS 14 Swift 5
- javascript - 如何使用javascript用超链接替换文本?
- c - 为什么 puts 函数会打印从文件中读取的最后一行并再一次存储在数组中?
- android - 已签名的 APK 网络问题 - 未签名的 apk 能够读取 API,但已签名的 apk 继续加载
- python - CSV 文件 - 如何通过用户输入替换一行数据?
- python - 我似乎找不到将滚动条添加到我的 tkinter 元素周期表的方法