Why are Python builds suddenly not Framework builds when using virtualenv?

后端 未结 5 1205
我寻月下人不归
我寻月下人不归 2020-12-29 15:15

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

5条回答
  •  星月不相逢
    2020-12-29 15:33

    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)

提交回复
热议问题