简体   繁体   English

在Mac OS 10.6.3上为PyGTK安装依赖项时出错

[英]Error while installing dependencies for PyGTK on Mac OS 10.6.3

I tried to install the following dependencies for PyGTK 2.16.0 (the Python GIMP Tool Kit) on Mac OS 10.6.3: 我尝试在Mac OS 10.6.3上为PyGTK 2.16.0(Python GIMP工具包)安装以下依赖项:

  • glib 2.25.5 glib 2.25.5
  • gettext-0.18 gettext-0.18
  • libiconv-1.13.1 libiconv-1.13.1

When I tried to install glib, I got the following error message: 当我尝试安装glib时,出现以下错误消息:

gconvert.c:55:2: error: #error GNU libiconv not in use but included iconv.h is from libiconv

The libiconv web page talks about a circular dependency between gettext and libiconv---build one, then build the other, then build the first again. libiconv网页讨论了gettext和libiconv之间的循环依赖关系-构建一个,然后构建另一个,然后再次构建第一个。 I tried to do this, though possibly incorrectly. 我尝试这样做,尽管可能不正确。 (Will the following work: make distclean; ./configure; make; sudo make install ?) (将执行以下工作: make distclean; ./configure; make; sudo make install吗?)

The author of a posting had the same problem, and he solved it by installing libiconv-1.13.1. 帖子的作者也遇到了同样的问题,他通过安装libiconv-1.13.1解决了该问题。

Could anyone explain the error in more detail, and how to correct it? 谁能更详细地解释该错误,以及如何纠正该错误?

Though it is an old question, still want to share the solution that worked for me. 尽管这是一个老问题,但仍想分享对我有用的解决方案。

Navigate to the 'glib' folder (just plain glib, the one INSIDE of the main glib source folder), and open 'gconvert.c' with your favorite editor. 导航到“ glib”文件夹(只是普通的glib,是主glib源文件夹的一个INSIDE),然后用您喜欢的编辑器打开“ gconvert.c”。

#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)
#error GNU libiconv in use but included iconv.h not from libiconv
#endif

#if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)
#error GNU libiconv not in use but included iconv.h is from libiconv
#endif

replace the last 3 lines, like so: 替换最后3行,如下所示:

#if defined(USE_LIBICONV_GNU) && !defined (_LIBICONV_H)
#error GNU libiconv in use but included iconv.h not from libiconv
#endif

#if !(defined(__APPLE__) && defined(__LP64__)) && !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H)
#error GNU libiconv not in use but included iconv.h is from libiconv
#endif

Source: http://letsneverdie.net/blog/?p=75 资料来源: http//letsneverdie.net/blog/?p = 75

The reason for the error message is that if you build glib against the current (~10.6.3) system installed version of libiconv on OS X, you need to pass --with-libiconv=gnu to the glib configure script. 出现该错误消息的原因是,如果您在OS X上针对当前(〜10.6.3)系统安装的libiconv版本构建glib,则需要将--with-libiconv = gnu传递给glib配置脚本。 However this isn't passed by default by the GTK-OSX build scripts. 但是,默认情况下,GTK-OSX构建脚本不会传递此参数。

The easy solution is to download the latest libiconv ( http://www.gnu.org/software/libiconv/#downloading ), and pass the location of your GTK install as the install prefix to configure eg: 简便的解决方案是下载最新的libiconv( http://www.gnu.org/software/libiconv/#downloading ),然后将GTK安装的位置作为安装前缀传递,以进行配置,例如:

$ cd libiconv-1.13.1/
$ ./configure --prefix=/Users/jamie/gtk/inst/
$ make && make install

With this version of libiconv, it seems that you don't need to pas --with-libiconv=gnu to glib configure, so you can now continue with the GTK-OSX build process by re-running the glib configure stage. 使用此版本的libiconv,似乎无需使用--with-libiconv = gnu来进行glib配置,因此现在可以通过重新运行glib配置阶段来继续GTK-OSX构建过程。

Since I have seen many reports of the MacPorts package manager being less reliable than the Fink package manager, I would suggest installing Fink, and then simply doing 由于我已经看到许多关于MacPorts软件包管理器不如Fink软件包管理器可靠的报告,我建议安装Fink,然后简单地进行

fink list pygtk  # Lists all pygtk packages
fink install pygtk2-gtk-py27  # This one, or the one that corresponds to your (Fink) Python

On top of that, Fink gives you access to more packages than MacPorts. 最重要的是,与MacPorts相比,Fink使您可以访问更多软件包。

I consider that "investing" in a package manager is a must, if you plan to use open-source programs. 我认为,如果您打算使用开源程序,则必须在程序包管理器中进行“投资”。

On a Mac, if you want to install GTK+, PyGTK, or certain other programs, you can download MacPorts . 在Mac上,如果要安装GTK +,PyGTK或某些其他程序,则可以下载MacPorts

In a terminal, type port search gtk to search for programs related to GTK+. 在终端中,键入port search gtk以搜索与GTK +相关的程序。 You will need an internet connection. 您将需要互联网连接。

Type sudo port install gtk2 to install GTK+2. 输入sudo port install gtk2来安装GTK + 2。 MacPorts will find and install any dependencies. MacPorts将查找并安装所有依赖项。

Type port installed to see the programs that you have installed using MacPorts. 键入port installed以查看使用MacPorts安装的程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM