pip install tensorflow fails - MAC OSError: [Errno 13] - tensorflow

I am trying to install tensorflow on mac Sierra. When I run pip install tensorflow I get following report.

It works fine for me by using command :
pip3 install https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.10.1-py3-none-any.whlrflow-1.10.1-py3-none-any.whl

run sudo pip install tensorflow

The problem appears to be, that you have not got the rights to install tensorflow globally. Therefore, one solution appears to be, that you try to install tensorflow locally using the following command:
pip install tensorflow --user

Related

Python cannot find Tensorflow module

With Python3.5, I try to use the 'tensorflow' module:
import tensorflow as tf
But.. it says No mudule named tensorflow
I just tried to download the module with pip3:
pip3 install --upgrade tensorflow-gpu
(I have all the requirements to run tensorflow with GPU support as described at tensorflow.org)
I've seen a similar question here ImportError: No module named tensorflow , here's a sum up of what's inside:
Make sure installation is correct via:
pip3 show tensorflow
You can optionally re-install it again using: pip install tensorflow==1.2.0 --ignore-installed
Make sure you're running the python code with Python 3.x, verify using: python --version
Make sure you install TF and run the script through the same user, avoid installing TF using sudo pip install... and running the code with python script.py

I am not able to update tensorflow installed with anaconda

I have been trying to update tensorflow from 1.2.1 to 1.3.
I did the following on my terminal:
pip3 install tensorflow --upgrade
After this, I tried checking the version
python3 -c 'import tensorflow as tf; print(tf.__version__)'
This outputs 1.2.1 but not 1.3.0
All this had been done in an anaconda environment.
Operating system: macOS Sierra
I would like to know how one can perform this update.
Thank you
The solution that I found was to install pip inside the conda environment and use that instance of pip to install the packages. Please refer here
The reason I got the above error was that the python3 and pip3 paths were different.
This became evident when I ran the below commands inside the conda environment.
which python3
/Users/SMBP/anaconda/envs/tensorflow/bin/python3
which pip3
/usr/local/bin/pip3
Also, I think it is better to use virtualenv and virtualenvwrapper if you wish to work with tensorflow as it is the recommended way.

Installing Tensorflow 1.3 (No module named tensorflow)

I am initializing a new VM with Ubuntu 17 on Google Cloud Platform, I then SSH into the newly created VM, upload this script and run it...
#! /bin/bash
sudo apt-get install python-pip
sudo pip install --upgrade pip
sudo pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.5.0-cp27-none-linux_x86_64.whl
Now, this works for me, when I launch a Python interactive environment
import tensorflow as tf
does not throw an error, however, if I run the same script but replace
tensorflow-0.5.0-cp27-none-linux_x86_64.whl
with
tensorflow-1.3.0-cp27-none-linux_x86_64.whl
I get:
ImportError: No module named tensorflow
... incredibly frustrating, especially since the contrib library doesn't seem to be apart of the 0.5 version... any ideas of what is going on, perhaps how I can first install 0.5 and then upgrade to 1.3 ?
I also get the same then i tried pip install tensorflow after worked fine

Tensorflow installation error

I am trying to install tensorflow with virtualenv
I have successfully went through the first 5 steps but on the 5th
pip install --upgrade tensorflow
I am getting an error
Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
Uninstalling numpy-1.8.0rc1:
OSError: [Errno 1] Operation not permitted: '/tmp/pip-Z5MKQS-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
You might be installing globally try adding sudo
sudo pip install --upgrade tensorflow
Otherwise just upgrade numpy separately with sudo and then you can try to install tensorflow locally.
I have no idea why you have that error.
But you can try with first installing pip3 and then try install with pip3 as
pip3 install --upgrade tensorflow
This will help you.

Getting permission denied error while installing tensorflow and keras

After following the steps from my previously asked question Can I implement deep learning models in my laptop with intel hd graphics
I am getting a permission denied error while installing tensorflow
What can I do to install tensorflow and keras without getting this error?
pip3 is trying to access /usr/bin/ for which you need superuser rights. Try
sudo pip3 install --upgrade ...
It appears that TensorFlow depends on a newer version of the setuptools package than you have installed. As Maximilian points out, pip needs root access to upgrade setuptools and install TensorFlow and Keras in your machine's Python distribution. You can either use sudo as he suggests, or it may be safer to install TensorFlow into a Virtualenv. For example, to create a Virtualenv in the directory ~/tensorflow, execute the following commands:
$ sudo pip install virtualenv
$ virtualenv --system-site-packages ~/tensorflow
$ cd ~/tensorflow
$ source bin/activate
$ pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.12.0-cp27-none-linux_x86_64.whl