If you're writing Python:
Do which -a python
to see how many Pythons you have installed.
If you see only /usr/bin/python
, then you're good to go.
If not:
Delete any non-homebrew non-system pythons (these will be pythons you installed from python.org). Important note: You don't want to remove your system Python. It comes with Mac OS X and is installed by Apple in /System/Library. If you haven't installed a Python from python.org, there is no need to uninstall anything. Don't delete anything in /System/Library!
rm -rf /Applications/MacPython\ <VERSION>
(might be Python instead of MacPython)
Remove everything that comes up in ls -al /usr/local/bin | grep /Library/Frameworks/Python.framework
for the version of Python you're uninstalling
rm -rf /Library/Frameworks/Python.framework
This will kill all versions of python.org Python. You may want to only remove a specific one.
Look in your .bash_profile
or .bashrc
Remove anything that the python.org Python added to your $PATH
Now:
brew install python
- includes pip, the python package manager
pip install virtualenv