9951 explained code solutions for 126 technologies


python-tensorflowHow can I use Anaconda to install TensorFlow in Python?


Anaconda is a free and open source distribution of Python that includes many popular data science and machine learning packages. It is an easy way to install TensorFlow in Python. To install TensorFlow using Anaconda, follow these steps:

  1. Open the Anaconda Prompt.
  2. Run the following command to create a virtual environment for TensorFlow:
conda create -n tensorflow_env tensorflow
  1. Activate the virtual environment:
conda activate tensorflow_env
  1. Install TensorFlow:
pip install --ignore-installed --upgrade tensorflow
  1. Verify the installation:
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

Output example

tf.Tensor(-14.335083, shape=(), dtype=float32)

For more information, please refer to the official TensorFlow documentation: https://www.tensorflow.org/install/pip

Edit this code on GitHub