无法安装pyg

2024-06-23 19:48:42 发布

您现在位置:Python中文网/ 问答频道 /正文

我知道有很多帖子中,人们在安装pygtk时遇到了问题,但没有一个真正为我做到了这一点。在

我在运行AntergosLinux。在

尝试通过pip进行安装时,我得到了以下信息:

$ pip install pygtk                                                                                                                                   maddin@maddins-pc
Collecting pygtk
  Using cached pygtk-2.24.0.tar.bz2
    Complete output from command python setup.py egg_info:
    ********************************************************************
    * Building PyGTK using distutils is only supported on windows. *
    * To build PyGTK in a supported way, read the INSTALL file.    *
    ********************************************************************

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8n79y5by/pygtk/

我查看了this page,但没有一个建议的解决方案对我有用。所以我从here下载了tar.gz,读取了INSTALL文件,并按照顶部的说明操作:

/配置:

^{pr2}$

make(错误来了):

$ make                                                                                                             maddin@maddins-pc
/bin/sh ./libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I/usr/include/python3.6m -I/usr/include/python3.6m -I/usr/include/pygtk-2.0 -I/usr/lib/libffi-3.2.1/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I./gtk  -DDISABLE_THREADING -I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -Wall -fno-strict-aliasing -std=c9x -MT atk_la-atkmodule.lo -MD -MP -MF .deps/atk_la-atkmodule.Tpo -c -o atk_la-atkmodule.lo `test -f 'atkmodule.c' || echo './'`atkmodule.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I/usr/include/python3.6m -I/usr/include/python3.6m -I/usr/include/pygtk-2.0 -I/usr/lib/libffi-3.2.1/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I./gtk -DDISABLE_THREADING -I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -g -O2 -Wall -fno-strict-aliasing -std=c9x -MT atk_la-atkmodule.lo -MD -MP -MF .deps/atk_la-atkmodule.Tpo -c atkmodule.c  -fPIC -DPIC -o .libs/atk_la-atkmodule.o
atkmodule.c:36:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
 DL_EXPORT(void)
 ^~~~~~~~~
atkmodule.c: In function ‘DL_EXPORT’:
atkmodule.c:37:1: error: expected declaration specifiers before ‘initatk’
 initatk(void)
 ^~~~~~~
atkmodule.c:48:1: error: expected ‘{’ at end of input
 }
 ^
atkmodule.c:48:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Makefile:609: atk_la-atkmodule.lo] Error 1

我也尝试过按照README-文件中的建议手动指定./configure --prefix=/usr/bin/python3.6,但结果是一样的。在

我现在能做什么?在


Tags: piplomakeincludelibusrerrorla

热门问题