无法在CenOS 6上构建wxPython 2.8.12.1

问题描述:

当尝试构建时,出现以下错误。 我截断了所有错误,没有找到包含文件。 我错过了什么?无法在CenOS 6上构建wxPython 2.8.12.1

python setup.py build 
WARNING: WXWIN not set in environment. Assuming '..' 
Found wx-config: /usr/local/bin/wx-config 
    Using flags: --toolkit=gtk2 --unicode=yes --version=2.8 
Preparing CORE... 
Preparing GLCANVAS... 
Preparing STC... 
running build 
running build_py 
copying wx/__version__.py -> build-gtk2.unicode/lib.linux-x86_64-2.6/wx 
copying wx/build/build_options.py -> build-gtk2.unicode/lib.linux-x86_64-2.6/wx/build 
package init file 'wx/lib/pubsub/pubsub1/__init__.py' not found (or not a regular file) 
package init file 'wx/lib/pubsub/pubsub2/__init__.py' not found (or not a regular file) 
package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not a regular file) 
package init file 'wx/lib/pubsub/pubsub1/__init__.py' not found (or not a regular file) 
package init file 'wx/lib/pubsub/pubsub2/__init__.py' not found (or not a regular file) 
package init file 'wx/tools/XRCed/plugins/__init__.py' not found (or not a regular file) 
running build_ext 
building '_stc' extension 
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -Iinclude -Isrc -I/usr/local/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/local/include/wx-2.8 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 -I/usr/include/python2.6 -c contrib/stc/gtk/stc_wrap.cpp -o build-gtk2.unicode/temp.linux-x86_64-2.6/contrib/stc/gtk/stc_wrap.o -pthread -O3 -pthread 
contrib/stc/gtk/stc_wrap.cpp:2680:24: error: wx/stc/stc.h: No such file or directory 

我在这里找到了一个好的开始。 http://wxpython.org/BUILD-2.8.html 我没有WXDIR变量。当我试图从bld目录运行时,它不起作用。所以我从源码目录再次尝试。我的配置线要简单得多。

./configure --with-gtk --enable-unicode 

我以前不明白的关键是如果我想要stc。我需要分别进行编译和安装。

make 
make -C contrib/src/stc 
sudo make install 
sudo make -C contrib/src/stc install 

笔者与

make $* \ 
    && make -C contrib/src/stc $* 

作品。使文件也很好。

记得还运行

sudo ldconfig 

如果需要其他的contrib的东西,看在什么是可用的contrib/src目录。

然后cd到wxPython目录。标准

python setup.py build 
python setup.py install 

似乎工作。

毕竟,我仍然需要将我的LD_LIBRARY_PATH设置为/ usr/local/lib。然后,我可以运行我一直试图安装的应用程序,这是一个机器人框架的GUI编辑器。

+0

非常感谢。保存了我的一天。这是非常糟糕的记录,但它是在标准操作系统(Debian)上安装非常标准的应用程序(Robot Framework)所需的路径。 – takumar 2016-07-07 12:02:34

本练习的要点是在CenOS 6上的wxPython 2.8.12.1。我无法找到可安装的二进制文件。在我构建项目之后,我找到了一个可以接受的二进制文件。我希望http://www.wxpython.org/也指向这个位置。 Enterprise Linux的额外软件包(EPEL)有这个项目和其他的在这里:https://fedoraproject.org/wiki/EPEL。 安装它们一个简单的方法是:

# yum install epel-release 
# yum install wxPython 

首先增加了EPEL释放到你的yum库。第二个安装wxPython。 wxPython网站上的二进制文件需要不同的gcc共享库。使用这个存储库确保匹配。