I am trying to install Tensorflow on Linux. Unfortunately, I can barely use Ubuntu.
I followed the page "https://www.tensorflow.org/versions/master/get_started/os_setup.html#create-the-pip-package-and-install"
and I am stuck at "Create the pip package and install" part.
When I typed "bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
" the terminal gives me below
No command 'bazel' found, did you mean:
Command 'babel' from package 'openbabel' (universe)
Command 'babel' from package 'babel-1.4.0' (universe)
bazel: command not found
What's wrong with it?
System requirements. TensorFlow only officially support Ubuntu. However, the following instructions may also work for other Linux distros. Note: Starting with TensorFlow 2.10 , Linux CPU-builds for Aarch64/ARM64 processors are built, maintained, tested and released by a third party: AWS.
You need to install "Bazel", google's homegrown build tool for building the sources. You can get it here: Installing Bazel
But if you are just getting started with this do you even need to bother with building from the source code?
Maybe you should try just installing the binaries using pip with a one line command as described here: pip installation
# Ubuntu/Linux 64-bit, CPU only:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
# Ubuntu/Linux 64-bit, GPU enabled:
$ sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.7.1-cp27-none-linux_x86_64.whl
I have faced similar problem. Then I realized that I forgot to set up the environment as follows:
export PATH="$PATH:$HOME/bin"
I wrote a small bash script that sets up Ubuntu to be ready to run TensorFlow. It may be of use to you:
https://github.com/jasonmayes/Tensor-Flow-on-Google-Compute-Engine
From the script here you can see how I install bazel, however that also has a number of dependencies :-)
wget https://github.com/bazelbuild/bazel/releases/download/0.1.5/bazel-0.1.5-installer-linux-x86_64.sh -O bazel-0.1.5-installer-linux-x86_64.sh
chmod +x bazel-0.1.5-installer-linux-x86_64.sh
sudo ./bazel-0.1.5-installer-linux-x86_64.sh --user
rm bazel-0.1.5-installer-linux-x86_64.sh
sudo chown $USER:$USER ~/.cache/bazel/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With