我正在使用anaconda python发行版(python版本2.7),我希望能够通过anaconda spyder应用程序(他们的IDE)在笔记本中或至少在ipython控制台中使用wxpython。我正在遇到一个显然是常见问题,这是由于anaconda python环境未被识别为具有GUI访问权限的框架。
事实上,当从命令行启动时,我可以直接在ipython中启动一个wxpython应用程序。但是,当试图从spyder IDE ipython控制台或ipython笔记本运行应用程序时,我收到此错误:
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.
如果有人知道解决方法,我会非常感谢你的建议。
谢谢!
答案 0 :(得分:0)
在运行调用wxpython函数的单元格之前的ipython笔记本中,你必须插入%gui
魔法:
%gui wx
答案 1 :(得分:0)
我相信当我使用MacBook时,简单地使用python w 与python有关。