Skip to content

Homebrew no longer hides macOS system python, so virtualenvwrapper breaks #1

@pedmiston

Description

@pedmiston

I don't use the macOS system python for anything. Instead, I install versions of python2 and python3 with Homebrew. It used to be that brew install python hid the system python by default or maybe with an --overwrite-system-python flag. Now they keep them separate, so if you type $ python you'll get the macOS system python, and if you want the Homebrew-installed pythons you have to type $ python2 or $ python3.

This is an issue for managing virtualenv when using virtualenvwrapper because the virtualenvwrapper script expects to use the python first on the path. Luckily you can change this by defining an additional environment variable telling virtualenvwrapper which python interpreter to use.

# in .bash_profile
# ...
export WORKON_HOME=$HOME/.venvs
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python2
source /usr/local/bin/virtualenvwrapper.sh

I'm opening this issue so I remember to add this information into the materials for this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions