8000 OSX virtualenv fixing by creating a simple alias by nils-werner · Pull Request #5516 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

OSX virtualenv fixing by creating a simple alias #5516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 7, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion doc/faq/virtualenv_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,12 @@ The issue has been reported on the virtualenv bug tracker `here
<https://github.com/pypa/virtualenv/issues/54>`__ and `here
<https://github.com/pypa/virtualenv/issues/609>`__

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
<http://wiki.wxpython.org/wxPythonVirtualenvOnMac>`_, is to use the non
virtualenv python along with the PYTHONHOME environment variable. This can be
Expand Down Expand Up @@ -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 <https://github.com/gldnspud/virtualenv-pythonw-osx>`_
provides an alternative workaround which may be used to solve the issue.
0