Install TensorFlow with Python3 on Ubuntu 16.04

When I try to install tensorflow package with pip3 on Ubuntu 16.04 I obtained this error message:

The directory '/home/federico/.cache/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 '/home/federico/.cache/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.
tensorflow-0.7.1-cp34-none-linux_x86_64.whl is not a supported wheel on this platform.

How I can fix the problem?

1

2 Answers

The issue is that Ubuntu 16 uses Python3.5 but Tensorflow only provides a wheel for Python 3.4 (indicated by 'cp34' in "tensorflow-0.7.1-cp34-none-linux_x86_64.whl"). Luckily the Wheel is actually compatible with Python 3.5, so you don't need to compile from source.

You need to download the wheel, rename it to prevent the python 3.4 check from failing, and then install by passing the renamed file to pip.

For the current version of Tensorflow (peeps in the future, check the website for the latest version and adapt commands below if necessary) run:

wget
mv tensorflow-0.8.0-cp34-cp34m-linux_x86_64.whl tensorflow-0.8.0-cp35-none-linux_x86_64.whl
pip install tensorflow-0.8.0-cp35-none-linux_x86_64.whl
1

use pip --- for python2 pip3 -- for python3 recommencement to use sudo

pip install --ignore-installed --upgrade 
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like