尝试安装 wxpython,但无论我如何尝试,都会出现多个错误

尝试安装 wxpython,但无论我如何尝试,都会出现多个错误

可能重复:
通过 pip 或 easy_install 安装 wxpython

我对 Python 和终端的使用还很陌生,下载 wxpython 时遇到了很多麻烦。我使用的是最新版本的 Mac OS X Lion,我尝试了两种方法:

  1. 如果我尝试 sudo pip install wxpython,我会得到:

    Downloading/unpacking wxpython
    Downloading wxPython2.8-win64-devel-2.8.12.1-msvc9x64.tar.bz2 (7.2Mb): 7.2Mb downloaded
    Running setup.py egg_info for package wxpython
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
      IOError: [Errno 2] No such file or directory: '/Users/michelletyler1/build/wxpython/setup.py'
      Complete output from command python setup.py egg_info:
      Traceback (most recent call last):
    
    File "<string>", line 14, in <module>
    
    IOError: [Errno 2] No such file or directory: '/Users/michelletyler1/build/wxpython/setup.py'
    
  2. 安装 MacPorts 后,我还尝试了 sudo port install py27-wxpython,得到以下结果:

    --->  Computing dependencies for py27-wxpython
    --->  Building py27-wxpython
    Error: org.macports.build for port py27-wxpython returned: command execution failed
    Please see the log file for port py27-wxpython for details:
       /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarbal        ls_ports_python_py-wxpython/py27-wxpython/main.log
    To report a bug, follow the instructions in the guide:
        http://guide.macports.org/#project.tickets
    Error: Processing of port py27-wxpython failed
    

另外,我一直在试图弄清楚如何改变我的 $PATH 以便 /usr/local/bin 位于 /usr/bin 之前(按照 brew doctor 的建议),但是当我去编辑我的 ~/.profile 时(根据我目前在网上找到的信息,我应该这样做),它不起作用。

谢谢您的帮助!

答案1

尝试下载安装程序:http://downloads.sourceforge.net/wxpython/wxPython2.8-osx-unicode-2.8.12.1-universal-py2.7.dmg

另外,请确保你以 32 位模式运行你的 Python 代码...即

#!/usr/bin/env python-32

import wx

相关内容