首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Python3Miniconda环境下的wxPython

Python3Miniconda环境下的wxPython
EN

Stack Overflow用户
提问于 2014-06-10 07:05:32
回答 1查看 1.5K关注 0票数 4

在OS上为Python3.3尝试wxPython凤凰(我不确定Python3phoix支持哪个版本,我强制-安装它)。

代码语言:javascript
复制
>>> 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.

现在我读到了,它说wxPython在虚拟环境中存在一个问题,并通过这个脚本提供了一个修复:

代码语言:javascript
复制
#!/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 "$@"

我看不懂巴什($@是什么?)但看起来这只是一个设置PYTHONHOME的问题。我在Python3上运行wxPython凤凰,而不是Python2,而且我也不使用虚拟环境。我是米尼康达。我不知道该把PYTHONHOME放哪。我在PYTHONHOME=“/Users/username/miniconda3 3/”中设置了它,但是它不起作用。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-06-10 16:55:15

更好的解决方法是使用pythonw (安装python.app conda包)而不是python

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/24134850

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档