diff --git a/doc/faq/virtualenv_faq.rst b/doc/faq/virtualenv_faq.rst index 89cf2736c8de..9c385aafd256 100644 --- a/doc/faq/virtualenv_faq.rst +++ b/doc/faq/virtualenv_faq.rst @@ -77,7 +77,12 @@ The issue has been reported on the virtualenv bug tracker `here `__ and `here `__ -Until this is fixed, a workaround is needed. The best known workaround, +Until this is fixed, one of the following workarounds must be used: + +``PYTHONHOME`` Script +--------------------- + +The best known workaround, borrowed from the `WX wiki `_, is to use the non virtualenv python along with the PYTHONHOME environment variable. This can be @@ -108,6 +113,27 @@ framework build within the virtualenv. To run a script you can do framework build. To run an interactive ``IPython`` session with the framework build within the virtual environment you can do ``frameworkpython -m IPython`` +``PYTHONHOME`` Function +----------------------- + +Alternatively you can define a function in your ``.bashrc`` using + +.. code:: bash + + function frameworkpython { + if [[ ! -z "$VIRTUAL_ENV" ]]; then + PYTHONHOME=$VIRTUAL_ENV /usr/local/bin/python "$@" + else + /usr/local/bin/python "$@" + fi + } + +This function can then be used in all of your virtualenvs without having to +fix every single one of them. + +PythonW Compiler +---------------- + In addition `virtualenv-pythonw-osx `_ provides an alternative workaround which may be used to solve the issue.