我已经下载了wxPython-src-2.9.4.0.tar.bz2从http://www.wxpython.org;现在我正在尝试按照构建说明进行操作http://www.wxpython.org/BUILD.html$ python build-wxpython.py --install
。到目前为止,我已经成功使用 构建它,没有任何错误。问题是我无法运行它:每次import wx
都会返回,。ImportError: No module named wx
我的系统有多个使用虚拟环境的 Python。运行构建后,可以找到这些文件以及我通常使用的其他包(在我的 site-packages 文件夹中):
wx.pth
wxPython_common-2.9.4.0-py2.7.egg-info
wxPython_common-2.9.4.1-py2.7.egg-info
我怀疑我把它安装在了错误的位置,我需要在构建它之前指定位置。但我不知道怎么做。
这是构建选项:
用法:build-wxpython.py [选项]
Options:
--version show program's version number and exit
-h, --help show this help message and exit
--build_dir=BUILD_DIR
Directory to store wx build files. (Not used on
Windows)
--clean Clean files from build directories. Default is all
build files. Specify 'wx' to clean just the wx build,
'py' for just the wxPython build, and 'pyext' for just
the built extension modules.
--debug Build wxPython with debug symbols
--extra_make=EXTRA_MAKE
Extra args to pass on [n]make's command line.
--extra_setup=EXTRA_SETUP
Extra args to pass on setup.py's command line.
--force_config Run configure when building even if the script
determines it's not necessary.
--install Install the built wxPython into installdir or standard
location
--installdir=INSTALLDIR
Directory to install wxWidgets to.
--mac_framework Build wxWidgets as a Mac framework.
--mac_lipo EXPERIMENTAL: Create a universal binary by merging a
PPC and Intel build together.
--no_config Turn off configure step on autoconf builds
--osx_cocoa Build the OS X Cocoa port on Mac (experimental)
--prefix=PREFIX Prefix value to pass to the wx build.
--reswig Allow SWIG to regenerate the wrappers
--unicode Build wxPython with unicode support (always on for
wx2.9)
--wxpy_installdir=WXPY_INSTALLDIR
Directory to install the wxPython binaries.
--build_dir=BUILD_DIR
有人能向我解释一下:和--installdir=INSTALLDIR
之间有什么区别--wxpy_installdir=WXPY_INSTALLDIR
?
我还应包括哪些其他参数$ python build-wxpython.py --install
?
答案1
哎呀!在认真阅读了构建选项中的描述后,我意识到这个问题有多愚蠢!--build_dir
是存储编译所需的文件,--installdir
是安装 wxWidgets 的位置,是用于 wxPython 二进制文件的位置--wxpy_installdir
- 每个都在构建选项中非常清楚地提到了!我对源代码编译的缺乏经验是如此明显。