WxPython in Python 3 Miniconda

Trying to use wxPython Phoenix for Python 3.3 on OS X. (I'm not sure which version of Python 3 Phoenix is ​​supported, I force it to be installed.

>>> import wx
>>> wx.App()
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.

Now I read this one which says that there is a problem with wxPython with virtualenv and a fix is ​​provided through this script:

#!/bin/bash

# what real Python executable to use
PYVER=2.7
PYTHON=/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\"), '..'))"`

# now run Python with the virtualenv set as Python HOME
export PYTHONHOME=$ENV 
exec $PYTHON "$@"

I can't read BASH (what is $ @ ?), But it looks like it's just a matter of installing PYTHONHOME. I am running wxPython Phoenix on Python 3, not Python 2. And I am not using virtualenv. I am Miniconda. I do not know where to install PYTHONHOME. I set it to PYTHONHOME = "/ Users / username / miniconda3 /", but it does not work.

+4
1

- pythonw ( python.app conda) python.

+4

Source: https://habr.com/ru/post/1543949/


All Articles