无法在 mac 上安装 wxGlade

Can't install wxGlade on mac

我下载了 wxGlade-0.7.2.tar.gz,并提取了它的内容。我还安装了 Python3.6、wxPython 和自制软件。

问题是,当我在 wxGlade-0.7.2 文件夹中 运行 "python wxglade.py" 时,我得到以下输出:

INFO    : Starting wxGlade version "0.7.2" on Python 2.7.10
INFO    : Base directory:             /Users/shihaoheng/Downloads/wxGlade-0.7.2
INFO    : Documentation directory:    /Users/shihaoheng/Downloads/wxGlade-0.7.2/docs
INFO    : Icons directory:            /Users/shihaoheng/Downloads/wxGlade-0.7.2/icons
INFO    : Build-in widgets directory: /Users/shihaoheng/Downloads/wxGlade-0.7.2/widgets
INFO    : Template directory:         /Users/shihaoheng/Downloads/wxGlade-0.7.2/templates
INFO    : Credits file:               /Users/shihaoheng/Downloads/wxGlade-0.7.2/CREDITS.txt
INFO    : License file:               /Users/shihaoheng/Downloads/wxGlade-0.7.2/LICENSE.txt
INFO    : Manual file:                /Users/shihaoheng/Downloads/wxGlade-0.7.2/docs/html/index.html
INFO    : Tutorial file:              /Users/shihaoheng/Downloads/wxGlade-0.7.2/docs/tutorial.html
INFO    : Home directory:             /Users/shihaoheng
INFO    : Application data directory: /Users/shihaoheng/.wxglade
INFO    : Configuration file:         /Users/shihaoheng/.wxglade/wxgladerc
INFO    : History file:               /Users/shihaoheng/.wxglade/file_history.txt
INFO    : Log file:                   /Users/shihaoheng/.wxglade/wxglade.log
INFO    : Current locale settings are:
INFO    :   Language code: zh_TW
INFO    :   Encoding: UTF-8
INFO    :   Filesystem encoding: utf-8
ERROR   : Please install missing Python module "wxversion".
Please install missing Python module "wxversion".

显然,它正在尝试在 Python2.7.10 上安装 glade(我相信我也安装了,虽然我不确定如何检查),我想知道错误是否是因为当我安装 wxPython 时,它会自动安装到我的 3.6 版本。

难道是这样吗?如果是这样,我如何将 wxPython 专门安装到旧版本的 python,这样我就不再收到此 "wxversion not found" 错误?

编辑:Python 2.7.13 没有安装,所以我刚才安装了它,然后 运行 "python2.7 wxglade.py",这给了我和以前一样的错误。我尝试用 brew 重新安装 wxPython,但出现错误 "Warning: wxpython 3.0.2.0 is already installed"。有没有办法专门为 python 2.7.13 版本或其他版本安装 wxPython?

因为你是 运行 这个在 Mac 上,你实际上可以用 Mac 安装包 OSX 二进制 WXPython 提供 here !

您可能需要第一个选项 (wxPython3.0-osx-carbon-py2.7),因为它适用于 Mac OS 的最新发行版,不过请检查文档以确保它是正确的。

这应该有助于清理您的环境并确保正确设置依赖项。

希望对您有所帮助!

将解决方案从问题移至答案:

解法:

Mac Sierra 尽可能地让这成为一件痛苦的事情,但我最终还是将各个部分拼凑起来以寻求解决方案。

步骤 1. 下载 wxGlade 'tarball' (.tar.gz) 文件。

Just download it from here, and extract it. Then, rename the folder 'wxGlade', and put it in your 'Applications' folder.

第 2 步。 确保安装了 python 2.7(wxGlade 不能与 python 3.5 一起使用)。

Click here and the 2.7.13 python pkg file will begin downloading. It is signed, so you should be able to install it without issues (otherwise, skip ahead to the step to enable installing unsigned pkg files).

Once it is finished, you can confirm it has been installed by entering the following into terminal:

 which python2

If it is indeed installed, it will return a directory. If not, it won't return anything.

步骤 3. 安装 wxPython。

The first thing you need to do is force Sierra (or El Capitan) to let you run unsigned package files. To do this, just open up terminal, and enter:

 sudo spctl --master-disable

The installation is a real pain in the ass on Sierra, because all of the binaries on the wxPython page no longer work - even the one of the exact same name and version of the binary I'm about to link you to: here. So although this is called 'cocoa-py2.7.dmg', the cocoa-py2.7.dmg available on the website will always fail, giving you the error message 'The installer could not install the software because there was no software found to install.'

Ranting aside, just follow that link, download the special version of cocoa-y2.7.dmg, and then run and install it. Finally, you have wxPython!

步骤 4.运行wxGlade

Use terminal to change directories (cd) to the extracted tar folder. If you renamed the extracted folder to 'wxGlade' and put it in your applications folder, you can do so instantly by entering the following command:

 cd /Applications/wxGlade

Once you have done so, enter the following run command into terminal:

 python2.7 wxglade.py

(It won't work if have python 3.5 and just type 'python wxglade.py').

Finally, wxGlade should be running!

您应该切换到更新版本的 wxGlade,可能还有 wxPython。 当前版本的 wxGlade 更好用并且支持 Python 3. 只需克隆存储库或从 https://bitbucket.org/wxglade/wxglade/get/default.zip

下载快照

wxPython Phoenix 现在可以从 PyPi 获得:https://pypi.python.org/pypi/wxPython

Sourceforge 上有一个 wxGlade 邮件列表 wxglade-general。

此致, 迪特玛