3

I want to use TensorFlow on my Mac with PyCharm, but when I use:

pip install https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

it gives an error:

    Exception:
    Traceback (most recent call last):
      File "/Users/urAD_Jeff/anaconda/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
        status = self.run(options, args)
.
.
.
      File "/Users/urAD_Jeff/anaconda/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 431, in send
        raise SSLError(e, request=request)
    SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)

How do I fix it?

Paul R
  • 208,748
  • 37
  • 389
  • 560
Jeffery Chen
  • 113
  • 1
  • 4

2 Answers2

2

I got it to install by running the following for a virtualenv setup recommended by the documentation

Install python

brew install python

Install tools

# On Mac:
$ sudo easy_install pip  # If pip is not already installed
$ sudo pip install --upgrade virtualenv

Setup virtualenv in ~/tensorflow directory

$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow

Activate virtualenv

$ source bin/activate  # If using bash
$ source bin/activate.csh  # If using csh
(tensorflow)$  # Your prompt should change

Install tensorflow (this is where I got the SSL error)

Download tensorflow from google getting the latest version using curl

curl -O https://storage.googleapis.com/tensorflow/mac/tensorflow-0.5.0-py2-none-any.whl

Install the package you downloaded

pip install tensorflow-0.5.0-py2-none-any.whl

You should be able to type python and try out tensorflow in a python terminal

Daniel
  • 2,950
  • 2
  • 25
  • 45
0

Another common issue in Mac while installing Tensor flow is Protobuf version.

Please make sure you have protobuf 3.0.0a3 or above.

Thanks to Github Issue on Tensorflow To install using homebrew

brew install --devel protobuf

To verify, please run

pip show numpy protobuf
suryakrupa
  • 3,852
  • 1
  • 25
  • 34