Python Forum

Full Version: python3 on Mac OS X
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi just starting out on the Mac with python3. Need help in installing python3 correctly. It comes with python2 but no pip.

I just installed python3 by downloading it from python website. Questions.
  • Where is pip? The python pip website say it is included. (If you have Python 2 >=2.7.9 or Python 3 >=3.4 installed from python.org, you will already have pip and setuptools, but will need to upgrade to the latest version)
  • What is the best way to make python3 to be my default python at the command line?

Here are the which paths:
/usr/bin/python (for python2 Python 2.7.10)
/usr/local/bin/python3 (for python3 Python 3.6.3 ).

Thanks
Have you tried "pip3" or perhaps even "pip3.6"? You can check the pip version from the command line with pip(n) -V where "n " is the version of Python, if needed.

C:\Python\Math>pip3 -V
pip 9.0.1 from C:\Python36\lib\site-packages (python 3.6)
If your "pip" is less than '9.0.1', you can upgrade with pip(n) install --upgrade pip , note: do not include a version number on the last "pip".
Hi yes, there is a pip3 and it is the latest.

Do I also need a separate pip for python 2.7 that came preinstalled on my Mac? How do I install that? Thanks again.
Installing Python 3 on Mac OS X
Quote:If the Homebrew version of Python 2 is installed then pip2 will point to Python 2.
f the Homebrew version of Python 3 is installed then pip3 will point to Python 3.
As use see there is normal to use python2 and python3,command to start version wanted.

Now do pyenv work on Mac,i always use it make it easy to install and change version.
I have tutorial for Linux here.

As a example.
mint@mint ~ $ pyenv install 3.6.3
Downloading Python-3.6.3.tar.xz...
-> https://www.python.org/ftp/python/3.6.1/Python-3.6.3.tar.xz
Installing Python-3.6.3...
Installed Python-3.6.3 to /home/mint/.pyenv/versions/3.6.3

# Make 3.6.3 the default python and pip version
mint@mint ~ $ pyenv global 3.6.3
Will make python and pip from command line point to Python 3.6.3.