【问题标题】:Running winpdb from within Enthought Canopy on MacOS 10.9.2在 MacOS 10.9.2 上从 Enthought Canopy 运行 winpdb
【发布时间】:2014-06-27 06:52:11
【问题描述】:

我在 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 的框架

【问题讨论】:

    标签: python wxpython enthought canopy


    【解决方案1】:

    这是一个已知问题,已在 Canopy 的下一版本(即将推出)中得到修复。与此同时,您应该能够通过编辑 winpdb 脚本中的第一行并将其设置为使用 pythonw 命令来解决该问题而不是蟒蛇。例如,改变这一行:

    #!/Users/<UserId>/Library/Enthought/Canopy_64bit/User/bin/python
    

    到:

    #!/Users/<UserId>/Library/Enthought/Canopy_64bit/User/bin/pythonw
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-16
    相关资源
    最近更新 更多