I've installed Python 2.7 as a Framework build on my Mac. I've installed and confirmed that wxPython works with this Python build. But when I create a virtual environment with virtualenv, the resulting Python executable isn't a Framework build, or at least not according to wxPython:
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.
Any ideas?
Another solution is to add the following script to /Path/To/VirtualEnv/bin:
ENV=`python -c "import sys; print sys.prefix"`
PYTHON=`python -c "import sys; print sys.real_prefix"`/bin/python
export PYTHONHOME=$ENV
exec $PYTHON "$@"
Then, whenever you want to run GUI (ex wxPython) use my_script main.py
(make sure that virtualenv is active)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With