Запуск примера кода hello-world, предлагаемого на сайте wxpython-phoenix , приводит к известной ошибке в osx.Подсказки о возможных решениях можно найти здесь и здесь , но ни один из них не работает с ipython и pycharm.
ВОПРОС: Как обойти этоизвестная ошибка при использовании ipython из pycharm?
Настройка:
OSX 10.12.5 Sierra
ipython 3.7.1 в conda venv
pycharm CE 2018.3
(также не выполняется из командной строки и из блокнота jupyter)
код запускается : (со страницы начала работы с wxpython)
import wx
app = wx.App()
frm = wx.Frame(None, title="Hello World")
frm.Show()
app.MainLoop()
сообщение об ошибке
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.
полный возврат
---------------------------------------------------------------------------
SystemExit Traceback (most recent call last)
<ipython-input-1-5af94fb54276> in <module>
3
4 # Next, create an application object.
----> 5 app = wx.App()
6
7 # Then a frame.
~/anaconda3/envs/py37/lib/python3.7/site-packages/wx/core.py in __init__(self, redirect, filename, useBestVisual, clearSigInt)
2100 # TODO: more description is needed for wxMSW...
2101
-> 2102 raise SystemExit(msg)
2103
2104 # This has to be done before OnInit
SystemExit: 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.
Примечание: этот вопрос похож на:
- тот тот, который был для python2.7, но не получил ответа
- тот тот, который предлагает устаревшие исправления для обычного python, кроме pycharm
Другие вопросы, такие как этот устарел для новой версии wxpython.