Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install TensorFlow on CentOS7
sudo yum -y install epel-release
sudo yum -y install gcc gcc-c++ python-pip python-devel atlas atlas-devel gcc-gfortran openssl-devel libffi-devel
# use pip or pip3 as you prefer for python or python3
pip install --upgrade virtualenv
virtualenv --system-site-packages ~/venvs/tensorflow
source ~/venvs/tensorflow/bin/activate
pip install --upgrade numpy scipy wheel cryptography #optional
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
# or below if you want gpu, support, but cuda and cudnn are required, see docs for more install instructions
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.10.0rc0-cp35-cp35m-linux_x86_64.whl
@jay13jay

This comment has been minimized.

Copy link

@jay13jay jay13jay commented Oct 18, 2016

First command should be # sudo yum -y install epel-release

@thoolihan

This comment has been minimized.

Copy link
Owner Author

@thoolihan thoolihan commented Oct 18, 2016

Thanks @jay13jay, fixed

@alt0xFF

This comment has been minimized.

Copy link

@alt0xFF alt0xFF commented Feb 13, 2017

perhaps this for the last command would be better: pip install --upgrade tensorflow-gpu

@ericparlin

This comment has been minimized.

Copy link

@ericparlin ericparlin commented Jun 23, 2017

I know its an older gist, but still useful, so wanted to note the following commands now work. The host OS should be detected by the build-server so no need to supply a build name to pip:
(CPU only)
'pip install --upgrade tensorflow'
(GPU support):
'pip install --upgrade tensorflow-gpu'

However, if you need a build name for some reason, for centOS7 (CPU only) latest right now is:
tensorflow-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl

@keyankay

This comment has been minimized.

Copy link

@keyankay keyankay commented Jul 13, 2017

I am running centos 7 and when i try to install the latest i get it is not supported wheel on this platform
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl
tensorflow-1.2.0-cp27-cp27mu-manylinux1_x86_64.whl is not a supported wheel on this platform.

@xyzhangcs

This comment has been minimized.

Copy link

@xyzhangcs xyzhangcs commented Aug 31, 2017

@keyankay
just run the below command:
for CPU only, run the command:

pip install --upgrade tensorflow

for GPU support, run the command:

pip install --upgrade tensorflow-gpu

@yoshi04cgn

This comment has been minimized.

Copy link

@yoshi04cgn yoshi04cgn commented Dec 21, 2017

Did anyone test this and does it work?

@EricSHo

This comment has been minimized.

Copy link

@EricSHo EricSHo commented May 28, 2018

For people who want to find out the tfBinaryURL of the latest whl for their platform, here is the page:

https://www.tensorflow.org/install/install_linux#the_url_of_the_tensorflow_python_package

@yangzhou95

This comment has been minimized.

Copy link

@yangzhou95 yangzhou95 commented Jan 3, 2019

@keyankay
just run the below command:
for CPU only, run the command:

pip install --upgrade tensorflow

for GPU support, run the command:

pip install --upgrade tensorflow-gpu

I'm using centos 7 on HPC, and this solution works perfectly. Thanks

@nevesLiliane

This comment has been minimized.

Copy link

@nevesLiliane nevesLiliane commented Jan 8, 2019

@keyankay
just run the below command:
for CPU only, run the command:

pip install --upgrade tensorflow

for GPU support, run the command:

pip install --upgrade tensorflow-gpu

I'm using CentOS 7 and when I tried this it I got "Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow"

uname = Linux xpto.localdomain 3.10.0-957.1.3.el7.x86_64 #1 SMP Thu Nov 29 14:49:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
python version = Python 3.7.1

@kitaev-chen

This comment has been minimized.

Copy link

@kitaev-chen kitaev-chen commented Jan 28, 2019

@nevesLiliane same with you, how to fix this finally?

UPDATE: I change python environment to 3.6, it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment