Add "path": "/Library/Frameworks/Python.framework/Versions/3.3/bin/"
to your Python3 build file. Mine looks like this:
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python",
"encoding": "utf8",
"path": "/Library/Frameworks/Python.framework/Versions/3.3/bin/"
}
Note: Make sure the path to Python3 is relative to your machine - that was true for mine
You can use virtualenv to create a local "copy" of the Python installation that's owned and easily manipulated by you. The advantage to using virtualenv is you can make many copies of the same version of Python, but with different versions of similar packages installed, and then switch between them with the virtualenv command line.
This lets you use different versions of libraries in different projects or incompatible libraries.
To install virtualenv:
sudo pip install virtualenv
And now you can use it yourself, without sudo, to create a virtual python owned by you:
mkdir -p ~/Development/mypythonproject
cd ~/Development/mypythonproject
virtualenv .venv
source .venv/bin/activate
For example:
IanCsiMac:~/Development/keybase-python |ruby-2.1.2| [git::develop]
> which python
/usr/local/bin/python
IanCsiMac:~/Development/keybase-python |ruby-2.1.2| [git::develop]
> source .venv/bin/activate
(.venv)
IanCsiMac:~/Development/keybase-python |ruby-2.1.2| [git::develop]
> which python
/Users/ian/code/keybase-python/.venv/bin/python
(.venv)
IanCsiMac:~/Development/keybase-python |ruby-2.1.2| [git::develop]
> deactivate
IanCsiMac:~/Development/keybase-python |ruby-2.1.2| [git::develop]
> which python
/usr/local/bin/python
You can virtualenv-install in your ~
directory if you want a default python that you control to be available at all times like so:
cd ~
virtualenv venv
And now you've got ~/venv/bin/pip
available to you. You can modify your ~/.bash_profile
and add:
source venv/bin/activate
Right at the end of it to have your virtualenv available by default in your shell.
Best Answer
If you had python 2.x and then installed python3, your pip will be pointing to pip3. you can verify that by typing pip --version which would be the same as pip3 --version.
On your system, you have now pip, pip2 and pip3.
If you want you can change pip to point to pip2 instead of pip3.
you can either add the alias to your ~/.bashrc
or add to your $PATH symlink named pip pointing to pip3 binary