9951 explained code solutions for 126 technologies


python-tensorflowHow do I install Python TensorFlow on Windows?


  1. Install Python on your Windows machine.
  2. Install pip package manager.
  3. Run the following command in the command prompt to install TensorFlow:
pip install tensorflow
  1. To check the version of TensorFlow installed, run the following command in the command prompt:
python -c "import tensorflow as tf; print(tf.__version__)"

Output example

2.3.0
  1. To use TensorFlow in your Python project, include the following code in your project:
import tensorflow as tf
  1. To create a TensorFlow session, use the following code:
sess = tf.Session()
  1. To close the session, use the following code:
sess.close()

Helpful links

Edit this code on GitHub