Skip to content

Instantly share code, notes, and snippets.

@rjleaf
Last active August 19, 2021 08:04
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rjleaf/77947dee87466c8a0b4d0b55c53c6107 to your computer and use it in GitHub Desktop.
Save rjleaf/77947dee87466c8a0b4d0b55c53c6107 to your computer and use it in GitHub Desktop.
Tensorflow on Fedora

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.

  1. 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
  1. Add Virtualenv to your PATH by issuing the following command:
sudo /usr/bin/easy_install virtualenv
  1. 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.
  1. 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
  1. Ensure pip >8.1 is installed:
(tensorflow)$ easy_install -U pip
  1. 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.

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