无需root权限安装pygobject

发布于 2024-12-17 12:47:00 字数 809 浏览 0 评论 0原文

我正在尝试在没有 root 权限的情况下安装 pygobject-2.11.3。我下载了源代码,当运行 ./configure --prefix=/home/my_username/local 时,我得到:

正在检查 GLIB - 版本 >= 2.8.0...否 * 无法运行 GLIB 测试程序,请检查原因... 测试程序编译或链接失败。请参阅文件 config.log 以了解 ** 发生的确切错误。这通常意味着 GLIB 安装不正确。 配置:错误:也许您想要 pygobject-2-4 分支?

所以我以同样的方式安装了 glib-2.8.6 (./configure --prefix=/home/my_username/local && make && make install) glib 没有错误消息。

尝试重新安装 pyobject 后,我​​收到相同的错误。

查看日志时,我看到: glib.h :没有这样的文件或目录

所以看来 pyobject 的 ./configure 脚本找不到 /home/my_username/local/include

/home/my_username/local 中的 glib.h我的 $PATH uname -a 的第一个元素

: Linux u205 2.6.9-42.ELsmp #1 SMP 7 月 12 日星期三 23:32:02 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux

感谢您的帮助

I am trying to install pygobject-2.11.3 without root permissions. I downloaded the source, and when running ./configure --prefix=/home/my_username/local i get :

checking for GLIB - version >= 2.8.0... no
* Could not run GLIB test program, checking why...
The test program failed to compile or link. See the file config.log for the
** exact error that occured. This usually means GLIB is incorrectly installed.
configure: error: maybe you want the pygobject-2-4 branch?

So i installed glib-2.8.6 the same way (./configure --prefix=/home/my_username/local && make && make install)
No error message for glib.

After trying to reinstall pyobject i get the same error.

When looking in the logs i see : glib.h : no such file or directory

So it seems the ./configure script of pyobject doesnt find glib.h which is in /home/my_username/local/include

/home/my_username/local is the first element of my $PATH

uname -a :
Linux u205 2.6.9-42.ELsmp #1 SMP Wed Jul 12 23:32:02 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux

Thanks for any help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

找个人就嫁了吧 2024-12-24 12:47:00

脚本configure使用pkg-config,并且假设您在非规范目录中安装了库,则需要设置变量PKG_CONFIG_PATH

在您的具体情况下,它应该是:

$ export PKG_CONFIG_PATH=/home/my_username/local/lib/pkgconfig

为了测试它,您可以尝试:

$ pkg-config --modversion glib-2.0

稍后您可以重新运行脚本配置。将来,您可能想看看 jhbuild

The script configure uses pkg-config and given you installed a library in a non-canonical directory, you need to set the variable PKG_CONFIG_PATH.

In your specific case, it should be:

$ export PKG_CONFIG_PATH=/home/my_username/local/lib/pkgconfig

In order to test it, you can try:

$ pkg-config --modversion glib-2.0

Later you can re-run the script configure. In the future, you might want to take a look to jhbuild.

恰似旧人归 2024-12-24 12:47:00

您需要将已安装的 GLIB 的路径添加到 LD_LIBRARY_PATH 中。

问候,
曼努埃尔

You need to add to LD_LIBRARY_PATH the path to the installed GLIB.

Regards,
Manuel

月寒剑心 2024-12-24 12:47:00

您需要设置 PYTHONPATH 环境变量,例如,

env PYTHONPATH=/home/my_username/local/lib/python/ <command>

如果您使用的是 Bash,请将其放入 bashrc 中:

export PYTHONPATH=/home/my_username/local/lib/python/

语义与 PATH 非常相似,除此之外Python 使用 PYTHONPATH 来查找模块,而 shell 使用 PATH 来查找命令。因此,您可以有多个目录:

export PYTHONPATH = "/code/proj_A/lib/python/:/code/proj_B/lib/python/"

请参阅文档更多信息。

You need to set the PYTHONPATH environment variable, e.g.

env PYTHONPATH=/home/my_username/local/lib/python/ <command>

If you are using Bash, put this in your bashrc:

export PYTHONPATH=/home/my_username/local/lib/python/

The semantics are very much the same as for PATH, apart from that PYTHONPATH it is being used by Python to look for modules, while PATH is used by the shell to look for commands. Therefore you can have multiple directories:

export PYTHONPATH = "/code/proj_A/lib/python/:/code/proj_B/lib/python/"

See the documentation for more information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文