Install tensorflow on ubuntu


  • There are different mechanisms.

             virtusalenv
             "native" pip
             docker
             anaconda


  • virtualenv is the recommended mechanism



  • virtualenv is a virtual python environment isolated from other python development



  • incapable of interfering with or being affected by other python programs on the same machine



  • during the virtualenv installation process, you will install not  only tensorflow but also the packages that the tensorflow requires.



  • To start working with tensorflow you simply need to activate the virtual enviornment.



  • all in all, virtualenv provides a safe and reliable mechanism for installing and running tensorflow.


Steps


  • install pip,dev and virtualenv


for python 2.7

sudo apt-get install python-pip python-dev python-virtualenv


  • create a virtualenv environment inside home


for python 2.7

virtualenv --system-site-packages tensorflow


  • activate theh virtualenv enviornment


source ~/tensorflow/bin/activate

or

 source ~/tensorflow/bin/activate.csh


  • ensure pip>=8.1 is installed


easy_install -U pip


  • install tensorflow in the active vitusalenv enviornment


for python 2.7

pip install --upgrade tensorflow


  • you must activate the virtusalenv environment each time you use tensorflow


source ~/tensorflow/bin/activate

or

 source ~/tensorflow/bin/activate.csh


  • when virtualenv environment is active you may run tensorflow programs from this shell



  • deactivate the virtualenv enviornment



deactivate



  • uninstall tensorflow


remove the tree you created

rm -r tensorflow




Comments

Popular posts from this blog