在OS上为Python3.3尝试wxPython凤凰(我不确定Python3phoix支持哪个版本,我强制-安装它)。
>>> import wx
>>> wx.App()
This program needs access to the screen. Please run with a
Framework build of python, and only when you are logged in
on the main display of your Mac.现在我读到了这,它说wxPython在虚拟环境中存在一个问题,并通过这个脚本提供了一个修复:
#!/bin/bash
# what real Python executable to use
PYVER=2.7
PYTHON=/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python$PYVER
# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"`
# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"我看不懂巴什($@是什么?)但看起来这只是一个设置PYTHONHOME的问题。我在Python3上运行wxPython凤凰,而不是Python2,而且我也不使用虚拟环境。我是米尼康达。我不知道该把PYTHONHOME放哪。我在PYTHONHOME=“/Users/username/miniconda3 3/”中设置了它,但是它不起作用。
发布于 2014-06-10 16:55:15
更好的解决方法是使用pythonw (安装python.app conda包)而不是python。
https://stackoverflow.com/questions/24134850
复制相似问题