我在MacOS 10.9.2上安装了Enthought Canopy 1.4。尝试运行winpdb
调试器会产生以下消息:
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.
作为一种解决方法,我尝试创建一个包含
的shell脚本run.sh
PYVER=2.7
PYTHON=/System/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\"), '..'))"`
export PATH=$OLD_PATH
# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"
尝试运行./run.sh winpdb
会导致错误消息
ImportError: No module named site
我的问题似乎与讨论的内容类似
Running wxPython 2.9 on OS X 10.8 (64 bit),
但那里的解决方案似乎并不适用,因为我似乎没有像/Library/Frameworks/EPD64.framework/...
这样的东西,即任何连接到Canopy或EPD的框架
答案 0 :(得分:3)
这是一个已知问题,已经为Canopy的下一个版本(即将推出)修复过。在此期间,您应该能够通过编辑winpdb脚本中的第一行并将其设置为使用pythonw命令来解决此问题而不是python。例如,更改此行:
#!/Users/<UserId>/Library/Enthought/Canopy_64bit/User/bin/python
为:
#!/Users/<UserId>/Library/Enthought/Canopy_64bit/User/bin/pythonw