Note: Adapted from official Ubuntu instructions for Tensorflow using virtualenv.
This gist is currently a "Work in Progress". It works, but requires superuser privileges. I have not tested it with GPU support.
- Install pip and Virtualenv by issuing one of the following commands:
sudo dnf install python-pip python-devel python-virtualenv # for Python 2.7
sudo dnf install python3-pip python3-devel python3-virtualenv # for Python 3.x
- Add Virtualenv to your PATH by issuing the following command:
sudo /usr/bin/easy_install virtualenv
- Create a Virtualenv environment by issuing one of the following commands:
virtualenv --system-site-packages targetDirectory # for Python 2.7
virtualenv --system-site-packages -p python3 targetDirectory # for Python 3.
- Activate the Virtualenv environment by issuing one of the following commands:
source ~/tensorflow/bin/activate # bash, sh, ksh, or zsh
source ~/tensorflow/bin/activate.csh # csh or tcsh
- Ensure pip >8.1 is installed:
(tensorflow)$ easy_install -U pip
- Issue one of the following commands to install Tensorflow in the active Virtualenv environment:
(tensorflow)$ pip install --upgrade tensorflow # for Python 2.7
(tensorflow)$ pip3 install --upgrade tensorflow # for Python 3.n
(tensorflow)$ pip install --upgrade tensorflow-gpu # for Python 2.7 and GPU
(tensorflow)$ pip3 install --upgrade tensorflow-gpu # for Python 3.n and GPU
If you run into any issues, please take a look at Google's official documentation for installing Tensorflow on Ubuntu. The instructions are mostly the same.