gpt4 book ai didi

macos - pkg-config 找不到 .pc 文件,尽管它们在路径中

转载 作者:行者123 更新时间:2023-12-04 02:33:25 30 4
gpt4 key购买 nike

我在 Mac OSX-Lion 上看到 pkg-config 的一个奇怪问题。为我下载的模块运行 python 设置时,我收到以下错误:

aspen:python toddysm$ sudo ./setup.py install
Password:
`pkg-config --libs --cflags cld` returns in error:
Package cld was not found in the pkg-config search path.
Perhaps you should add the directory containing `cld.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cld' found

The `cld` C++ library is absent from this system. Please install it.

但是,当检查/usr/local/lib 文件夹时,我看到 libs 和 .pc 文件位于 pkgconfig 子文件夹中
aspen:~ toddysm$ cd /usr/local/lib/
aspen:lib toddysm$ ls -al
total 2640
drwxr-xr-x 6 root wheel 204 Jul 2 17:38 .
drwxr-xr-x 9 root wheel 306 Jul 2 15:17 ..
-rwxr-xr-x 1 root wheel 1339516 Jul 2 17:38 libcld.0.dylib
lrwxr-xr-x 1 root wheel 14 Jul 2 17:38 libcld.dylib -> libcld.0.dylib
-rwxr-xr-x 1 root wheel 918 Jul 2 17:38 libcld.la
drwxr-xr-x 3 root wheel 102 Jul 2 17:38 pkgconfig
aspen:lib toddysm$ cd pkgconfig/
aspen:pkgconfig toddysm$ ls -al
total 8
drwxr-xr-x 3 root wheel 102 Jul 2 17:38 .
drwxr-xr-x 6 root wheel 204 Jul 2 17:38 ..
-rw-r--r-- 1 root wheel 279 Jul 2 17:38 cld.pc

使用命令行将 PKG_CONFIG_PATH 设置为指向/usr/local/lib/没有帮助。出于某种原因将其设置为 ~/.bash_profile 会使 pkg-config 无法识别为命令。

我的假设是我缺少一些依赖,但不确定是什么。在 Linux 上尝试相同的操作时,我错过了 Python 开发包 python2.7-dev 但我不确定如何在 Mac 上检查它(是否存在)。

任何帮助将不胜感激。

最佳答案

您可以列出目录pkg-config默认情况下使用:

pkg-config --variable pc_path pkg-config
PKG_CONFIG_PATH需要完整的 /usr/local/lib/pkgconfig附加到变量的路径名。

关于macos - pkg-config 找不到 .pc 文件,尽管它们在路径中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11303730/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com