OS X (Mavericks) has Python 2.7 stock installed. But I do all my own personal Python stuff with 3.3. I just flushed my 3.3.2 install and installed the new 3.3.3. So I need to install pyserial
again. I can do it the way I've done it before, which is:
- Download pyserial from pypi
- untar pyserial.tgz
- cd pyserial
python3 setup.py install
But I'd like to do like the cool kids do, and just do something like pip3 install pyserial
. But it's not clear how I get to that point. And just that point. Not interested (unless I have to be) in virtualenv yet.
Here is my simple solution:
If you have python2 and python3 both installed in your system, the pip upgrade will point to python2 by default. Hence, we must specify the version of python(python3) and use the below command:
This command will uninstall the previously installed pip and install the new version- upgrading your pip.
This will save memory and declutter your system.
Image - How the upgrading of pip in Python3 works on MacOS
I had the same problem with python3 and pip3. Decision: solving all conflicts with links and other stuff when do
After that
simply run following on terminal if you don't have pip installed on your mac.
download python 3 here: python3
once you're done with these 2 steps, make sure to run the following to verify whether you've installed them successfully.
brew install python3
create alias in your shell profile
alias pip3="python3 -m pip"
in my.zshrc
➜ ~ pip3 --version
pip 9.0.1 from /usr/local/lib/python3.6/site-packages (python 3.6)
UPDATE: This is no longer necessary with Python3.4. It installs pip3 as part of the stock install.
I ended up posting this same question on the python mailing list, and got the following answer:
Which solved my question perfectly. After adding the following for my own:
So that I could run pip directly, I was able to:
or:
On
Mac OS X Mojave
python
stands for python of version 2.7 andpython3
for python of version 3. The same ispip
andpip3
. So, to upgradepip
forpython 3
do this: