无需root权限安装pygobject
我正在尝试在没有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
脚本configure使用pkg-config,并且假设您在非规范目录中安装了库,则需要设置变量
PKG_CONFIG_PATH
。在您的具体情况下,它应该是:
为了测试它,您可以尝试:
稍后您可以重新运行脚本配置。将来,您可能想看看 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:
In order to test it, you can try:
Later you can re-run the script configure. In the future, you might want to take a look to jhbuild.
您需要将已安装的 GLIB 的路径添加到 LD_LIBRARY_PATH 中。
问候,
曼努埃尔
You need to add to LD_LIBRARY_PATH the path to the installed GLIB.
Regards,
Manuel
您需要设置
PYTHONPATH
环境变量,例如,如果您使用的是 Bash,请将其放入 bashrc 中:
语义与
PATH
非常相似,除此之外Python 使用 PYTHONPATH 来查找模块,而 shell 使用 PATH 来查找命令。因此,您可以有多个目录:请参阅文档更多信息。
You need to set the
PYTHONPATH
environment variable, e.g.If you are using Bash, put this in your bashrc:
The semantics are very much the same as for
PATH
, apart from thatPYTHONPATH
it is being used by Python to look for modules, whilePATH
is used by the shell to look for commands. Therefore you can have multiple directories:See the documentation for more information.