It looks like the parameter to add the wx include folder is not being used. Since you specified no prefix in the wx build then it should have installed to the /usr/local prefix, correct? Is /usr/local/bin on your PATH? If so, is it before /usr/bin? What do you get when you run "which wx-config"? What about "wx-config --cxxflags"?
If setup.py is finding the wrong wx-config then you can tell it which one to use by adding WX_CONFIG=/usr/local/bin/wx-config (or whatever) to the command line.
I also try to add WX_CONFIG=/usr/local/bin/wx-config(and it do exit in the dir ),and I run the sudo python setup.py install again, but the output is still the same.
There is few things i wonder may matter:
I once installed the wxpython from ubuntu apt-get command,which i learned from the wiki page.
And it works perfectly in python2.6,but not the python2.7.And i have removed them before i complie the source code via “sudo apt-get remove …”
在 2013年3月23日星期六UTC+8上午3时56分19秒,Robin Dunn写道:
···
zhkzyth wrote:
Hi all,
I am working on ubuntu 10.04 with python2.7, and i try to compile the
wxpython from source code.I take the flow steps:
cd $wxDir;
./configure
make
make install
----- and it done perfectly.
Then i try to install the python extention, and flow below steps:
It looks like the parameter to add the wx include folder is not being
used. Since you specified no prefix in the wx build then it should have
installed to the /usr/local prefix, correct? Is /usr/local/bin on your
PATH? If so, is it before /usr/bin? What do you get when you run
“which wx-config”? What about “wx-config --cxxflags”?
If setup.py is finding the wrong wx-config then you can tell it which
one to use by adding WX_CONFIG=/usr/local/bin/wx-config (or whatever) to
the command line.
I also try to add WX_CONFIG=/usr/local/bin/wx-config(and it do exit in
the dir ),and I run the `sudo python setup.py install` again, but the
output is still the same.
The output from wx-config --cxxflags should be being used in the compile command lines in the wxPython build, but those flags were not in the compile command line you showed before. So either it is not finding the right wx-config (or any at all) or it is unable to execute it for some reason. That is where you need to focus your trouble-shooting efforts. Are there any messages from the beginning of the setup.py run about wx-config?
Hi Robin:
I finally get your point=.=…sorry for my poor english.
I run the following command:
➜ wxPython sudo python setup.py install
WARNING: WXWIN not set in environment. Assuming ‘…’
Found wx-config: /usr/local/bin/wx-config
Using flags: --toolkit=gtk2 --unicode=yes --version=2.8
Warning: No config found to match: /usr/local/bin/wx-config --toolkit=gtk2 --unicode=yes --version=2.8 --cxxflags
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.
…
Also , i find that the lib the wxpython trying to find is located in /usr/include/wx-2.8/wx in my pc , not the /usr/include/wx/ .But the include/wx/wxPython/wxPython_init.h asked for the latter one.
So i cp /usr/include/wx-2.8/wx to /usr/include/wx, and the compile out did not show the “file or dir not exit” error message.But this time it shows another error:
Preparing STC…
Preparing GIZMOS…
running install
running build
running build_py
copying wx/version.py → build-gtk2.unicode/lib.linux-x86_64-2.7/wx
copying wx/build/build_options.py → build-gtk2.unicode/lib.linux-x86_64-2.7/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 ‘core’ extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DSWIG_TYPE_TABLE=_wxPython_table -DSWIG_PYTHON_OUTPUT_TUPLE -DWXP_USE_THREAD=1 -UNDEBUG -D_REENTRANT -Iinclude -Isrc -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/directfb -I/usr/include/libpng12 -I/usr/local/include/python2.7 -c src/helpers.cpp -o build-gtk2.unicode/temp.linux-x86_64-2.7/src/helpers.o -O3 -pthread
cc1plus: warning: command line option “-Wstrict-prototypes” is valid for Ada/C/ObjC but not for C++
In file included from /usr/include/wx/defs.h:21,
from /usr/include/wx/wx.h:15,
from include/wx/wxPython/wxPython_int.h:19,
from src/helpers.cpp:16:
/usr/include/wx/platform.h:196:22: error: wx/setup.h: No such file or directory
In file included from /usr/include/wx/platform.h:293,
from /usr/include/wx/defs.h:21,
from /usr/include/wx/wx.h:15,
from include/wx/wxPython/wxPython_int.h:19,
from src/helpers.cpp:16:
It seems like the reference is still wrong.Does the "wxPython-src-2.8.12.1.tar.bz2 " package works with ubuntu10.04 and python2.7?
在 2013年3月26日星期二UTC+8上午12时22分28秒,Robin Dunn写道:
···
zhkzyth wrote:
Hi Robin,
Sorry for the late reply.
I try to run the command that you said.Below is the result:
➜ wxPython which wx-config
/usr/local/bin/wx-config
I also try to add WX_CONFIG=/usr/local/bin/wx-config(and it do exit in
the dir ),and I run the sudo python setup.py install again, but the
output is still the same.
The output from wx-config --cxxflags should be being used in the compile
command lines in the wxPython build, but those flags were not in the
compile command line you showed before. So either it is not finding the
right wx-config (or any at all) or it is unable to execute it for some
reason. That is where you need to focus your trouble-shooting efforts.
Are there any messages from the beginning of the setup.py run about
wx-config?
Hi Robin:
I finally get your point=.=..sorry for my poor english.
I run the following command:
➜ wxPython sudo python setup.py install
WARNING: WXWIN not set in environment. Assuming '..'
Found wx-config: /usr/local/bin/wx-config
Using flags: --toolkit=gtk2 --unicode=yes --version=2.8
Warning: No config found to match: /usr/local/bin/wx-config
--toolkit=gtk2 --unicode=yes --version=2.8 --cxxflags
in /usr/local/lib/wx/config
If you require this configuration, please install the desired
library build. If this is part of an automated configuration
test and no other errors occur, you may safely ignore it.
You may use wx-config --list to see all configs available in
the default prefix.
........
Did you run "wx-config --list" as suggested above to see what configurations are present? My guess is that you did not build the unicode version of wxWidgets.
Also , i find that the lib the wxpython trying to find is located in
/usr/include/wx-2.8/wx in my pc , not the `/usr/include/wx/ `.But the
include/wx/wxPython/wxPython_init.h asked for the latter one.
So i cp `/usr/include/wx-2.8/wx` to `/usr/include/wx`, and the compile
out did not show the "file or dir not exit" error message.But this time
it shows another error:
That will be the wrong one anyway. Since you are using the wx-config installed in /usr/local/bin then it should be using headers installed under /usr/local/include. If you get the correct wxWidgets built and installed, or change the setup.py flags so it will use the build you already have, then it should add the compile flags needed to get the headers from /usr/local/include.