我在mac上安装了anaconda,而不是系统的python,但是当我键入
import wx
app = wx.App()我拿到了这个:
这个程序需要访问屏幕。请使用python的框架构建来运行,并且只有在Mac的主屏幕上登录时才能运行。
我使用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 "$@"但它只是使用了系统python.Can,不能在anaconda中使用lib。我想在anaconda中使用wx,如何解决这个问题?
发布于 2017-06-19 23:44:49
我通过阅读这篇文章(参见下面的技巧)解决了Python 2和3虚拟env的问题:
我的环境是:
提示:
https://stackoverflow.com/questions/39989975
复制相似问题