【问题标题】:executable not found in path even if it is in the right directory即使在正确的目录中,在路径中也找不到可执行文件
【发布时间】:2022-10-25 15:41:12
【问题描述】:

我的/bin/ 目录中有一个pg_config 文件,而我的/bin/ 目录在$PATH 中,但是当我运行$PATH pg_config 时,它说找不到该文件:

有谁知道它来自哪里?

更新:当我刚刚运行'pg_config'时,我有这个:

[root@PF9SODEVSTU048 clickandqualif]# pg_config
BINDIR = /usr/bin
DOCDIR = /usr/share/doc/pgsql
HTMLDIR = /usr/share/doc/pgsql
INCLUDEDIR = /usr/include
PKGINCLUDEDIR = /usr/include/pgsql
INCLUDEDIR-SERVER = /usr/include/pgsql/server
LIBDIR = /usr/lib64
PKGLIBDIR = /usr/lib64/pgsql
LOCALEDIR = /usr/share/locale
MANDIR = /usr/share/man
SHAREDIR = /usr/share/pgsql
SYSCONFDIR = /etc

我应该指定我想在路径中找到“pg_config”的原因。 我的 requirements.txt 中有“psycopg2-binary==2.9.4”,当它尝试安装 psycopg2 并出现以下错误时失败:

Error: pg_config executable not found.

    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 ...

    or with the pg_config option in 'setup.cfg'.

正因为如此,我想知道我的 'pg_config' 文件是否真的在我的 $PATH 中

【问题讨论】:

    标签: linux


    【解决方案1】:

    而不是打字

    $PATH pgconfig
    

    只需键入

    pgconfig
    

    这将在 PATH 变量中列出的每个目录中搜索 pgconfig。

    【讨论】:

    • 谢谢,我更精确地编辑了我的帖子
    猜你喜欢
    • 1970-01-01
    • 2017-05-26
    • 2013-07-16
    • 2016-08-10
    • 2018-07-15
    • 1970-01-01
    • 2017-11-08
    • 2016-05-18
    • 1970-01-01
    相关资源
    最近更新 更多