How to install tensorflow and keras in jupyter anaconda

How to install tensorflow and keras in jupyter anaconda

1. install in a virtual environment  Anaconda

Download Anaconda for your platform and choose the Python 3.6 version: https://www.anaconda.com/download

By downloading Anaconda, you get conda, Python, Jupyter Notebook and hundreds of other open source packages.

 

conda install — installs any software package.

Open Anaconda and then conda shell (CMD.exe  Prompt)

2. Install TensorFlow (including Keras)

# install pip in the virtual environment

# install Tensorflow CPU version

$ pip install --upgrade tensorflow # for python 2.7

$ pip3 install --upgrade tensorflow # for python 3.*

# install Keras (Note: please install TensorFlow first)

$ pip install Keras

 

# invoke python from your shell

$ python

# create a simple TensorFlow program inside the python interactive shell

>>> import tensorflow as tf

>>> hello = tf.constant('Hello, TensorFlow!')

>>> sess = tf.Session()

>>> print(sess.run(hello))

# Exit the python shell

Ctrl+D

 

Enjoyed this article? Stay informed by joining our newsletter!

Comments

You must be logged in to post a comment.

About Author