Yunti
Yunti

Reputation: 7458

python 3 symlinked to python 2 - how to undo

Running brew doctor gave me the error recently that python 3 is symlinked to python. And when I type python - it does load python 3.4 interpreter. I'm not sure how it happened. I did recently changed the default installed python with virtualenv to python3 (most projects are python 3) with :

export VIRTUALENV_PYTHON=python3

would this have changed the symlink and what's the best way to change back as

export VIRTUALENV_PYTHON=python

didn't fix it, although I suspect that's because it's already symlinked. (I've used brew to install python 2.7 and python 3 and these were previously fine).

(if changing the virtualenv setting has caused the issue is there another way to make the default python3 without causing the symlink issue?)

Upvotes: 1

Views: 1865

Answers (1)

Burhan Khalid
Burhan Khalid

Reputation: 174672

You should update brew, then prune any stale links and then re-link Python 2.

  1. brew update
  2. brew upgrade (optional, but highly recommended)
  3. brew prune
  4. brew unlink python && brew link python

Upvotes: 2

Related Questions