Python for Mac OS X. Pip tool to simplify installing and managing additional packages. Pip is included with Python 3.4 releases; for earlier releases, follow the pip install instructions. Among the packages available through PyPI are some that are specifically for OS X environments. Aug 28, 2018 For example, I want to use 'pip' to install the torch or tensorflow into pyenv python 2.7.14. But don't want to install them into system default python. Also, how to change the pip3 version? Here I using the which pip and which pip3, the results are: haos-mbp: hao$ which pip /Users/hao/.pyenv/shims/pip haos-mbp: hao$ which pip3 /usr/local/bin. 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.
Python3 should already be installed since Mac OS X High Sierra, but pip3 may not yet be installed.
On Mac OS you should be able to launch a Terminal, which looks like this…
Ensure Python3 is Available
After it has launched, type the following into the Terminal and press Enter
python3
If python3 is installed this should launch the python shell, and take you to an interactive python prompt which looks like >>>
where you can type 4+4, and press Enter to see 8. For example…
Python 3.6.5 (v3.6.5:f59c0932b4, Mar 28 2018, 03:03:55)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3) on darwin
Type “help”, “copyright”, “credits” or “license” for more information
>>> 4+4
8
If it launched a python shell as expected, press CTRL+D to exit the shell.
If python3 is not installed, the shell will not launch and it will instead report…
-bash: python3: command not found
If you don’t yet have python3, you can download a Mac OS installer for python 3.6.5 by clicking here.
Ensure Pip3 is Available
Once you have python3 installed, type the following into Terminal and press Enter.
pip3 --version
This should show the version of pip3 like…
pip 9.0.3 from /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (python 3.6)
If you see a version report, keep the console window open and proceed to configuring your pip3 install using Terminal.
If pip3 is not installed you will see
-bash: pip3: command not found
Pip Install To Python 2.7
Use python3 to install pip3 by copy-pasting the command lines below into the Mac OS Terminal prompt, pressing Enter each time…
curl -O https://bootstrap.pypa.io/get-pip.py
(This command line uses the curl downloader to download a script file to the current directory)
Mac Os Install Pip For Python 3
sudo python3 get-pip.py
(This command line uses sudo to run the downloaded script with root privileges)
After the script completes, keep the console window open and proceed to configuring your pip3 install using Terminal