Enthought的Python 3发行版缺少pythonw



我有一个wxpython gui,需要使用Enth 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 Line

#/usr/bin/env python

让我的脚本与EDM Python 3一起使用。

那么,有没有一种方法可以使用EDM Python 3使用Pythonw?

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

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

最新更新