[python] pip3: command not found

I want to install Tensorflow following this instructions. https://www.tensorflow.org/versions/r0.12/get_started/os_setup#pip_installation.

But when I try this code on terminal, it returns an error.

$ sudo pip3 install --upgrade $TF_BINARY_URL
sudo: pip3: command not found

So I installed Homebrew and tried to uninstall and reinstall pip-3, but didn't work.

MakotonoMacBook-ea:~ makotomiyazaki$ brew uninstall python3-pip
Error: No such keg: /usr/local/Cellar/python3-pip

MakotonoMacBook-ea:~ makotomiyazaki$ brew install python3-pip
Error: No available formula with the name "python3-pip" 
==> Searching for a previously deleted formula...
Warning: homebrew/core is shallow clone. To get complete history run:
  git -C "$(brew --repo homebrew/core)" fetch --unshallow

What should I do for getting pip3? My OS is macOS High Sierra, and I have python 3.6.2 already installed.

EDIT: I tried

python3 -m pip

and what's returned was this.

The directory '/Users/makotomiyazaki/Library/Caches/pip/http' or its 
parent directory is not owned by the current user and the cache has 
been disabled. Please check the permissions and owner of that 
directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/makotomiyazaki/Library/Caches/pip' or its parent 
directory is not owned by the current user and caching wheels has been 
disabled. check the permissions and owner of that directory. If 
executing pip with sudo, you may want sudo's -H flag.
You must give at least one requirement to install (see "pip help 
install")

I also tried which pip3, but just I don't know if it worked...

MakotonoMacBook-ea:~ makotomiyazaki$ sudo which pip3 install --upgrade $TF_BINARY_URL
/usr/bin/install

This question is related to python tensorflow homebrew pip3

The answer is


After yum install python3-pip, check the name of the installed binary. e.g.

ll /usr/bin/pip*

On my CentOS 7, it is named as pip-3 instead of pip3.


I had this issue and I fixed it using the following steps You need to completely uninstall python3-p using:

sudo apt-get --purge autoremove python3-pip

Then resintall the package with:

 sudo apt install python3-pip

To confirm that everything works, run:

 pip3 -V

After this you can now use pip3 to manage any python package of your interest. Eg

pip3 install NumPy

Writing the whole path/directory eg. (for windows) C:\Programs\Python\Python36-32\Scripts\pip3.exe install mypackage. This worked well for me when I had trouble with pip.


Try this if other methods do not work:

  1. brew install python3
  2. brew link --overwrite python
  3. brew postinstall python3

its possible if you already have a python installed (pip) you could do a upgrade on mac by

brew upgrade python

Examples related to python

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

Examples related to tensorflow

Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation Module 'tensorflow' has no attribute 'contrib' Tensorflow 2.0 - AttributeError: module 'tensorflow' has no attribute 'Session' Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: How do I use TensorFlow GPU? Which TensorFlow and CUDA version combinations are compatible? Could not find a version that satisfies the requirement tensorflow pip3: command not found How to import keras from tf.keras in Tensorflow? Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX AVX2

Examples related to homebrew

dyld: Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.62.dylib error running php after installing node with brew on Mac How can I install a previous version of Python 3 in macOS using homebrew? SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443 pip3: command not found env: node: No such file or directory in mac Stuck at ".android/repositories.cfg could not be loaded." Brew install docker does not include docker engine? What do raw.githubusercontent.com URLs represent? Homebrew refusing to link OpenSSL

Examples related to pip3

pip3: command not found