【问题标题】:pythonw missing with Enthought's distribution of Python 3Python 3 的 Enthought 发行版中缺少 pythonw
【发布时间】:2017-04-18 18:43:00
【问题描述】:

我有一个 wxPython GUI,需要使用 Enthought Python (EDM) 和 Anaconda Python 与 Python 3 一起运行。

问题是,在使用 Anaconda Python 时,我必须使用 pythonw 否则脚本会因以下错误而失败:

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.

以前,我使用 Python 2.x 解决了这个问题:

#/usr/bin/env pythonw

适用于 Canopy Python 2 和 Anaconda Python 2。

但是,EDM Python 3 似乎缺少 pythonw.exe,所以我必须将 shebang 行编辑为

#/usr/bin/env python

让我的脚本在 EDM python 3 中运行。

那么,有没有办法将 pythonw 可执行文件与 EDM python 3 一起使用?

【问题讨论】:

    标签: python python-3.x anaconda enthought


    【解决方案1】:

    当然。只需创建一个名为pythonw 的脚本并将其放入$PATH

    #!/bin/sh
    
    exec /usr/bin/env python "$@"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-03-10
      • 2013-04-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-23
      • 2012-08-26
      • 1970-01-01
      相关资源
      最近更新 更多