I installed anaconda instead of system's python on mac,but when I type
import wx
app = wx.App()
I got this:
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.
I use the 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's HOME
export PYTHONHOME=$ENV
exec $PYTHON "$@"
but it just used the system python.Can't use the lib in anaconda. I want to use the wx GUI in anaconda,how to solve the problem?
I fixed the issue for my Python 2 and 3 virtual envs by reading this post (see my tip in the followed):
My environment is:
Tips:
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