How to install Tensorflow on Windows?

by alyson_bogan , in category: General Help , 3 months ago

How to install Tensorflow on Windows?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer


by emie , 3 months ago


To install Tensorflow on Windows, follow these steps:

  1. Check your system requirements: Tensorflow requires Python 3.5, 3.6, or 3.7. Ensure you have a compatible version of Python installed on your system.
  2. Create a virtual environment (optional but recommended): Open Command Prompt or PowerShell. Enter the following command to install the virtualenv package (if not already installed): pip install virtualenv Create a new virtual environment by running the following command: virtualenv env_name Replace "env_name" with the name you want for your virtual environment.
  3. Activate the virtual environment (optional but recommended): In Command Prompt or PowerShell, navigate to the directory where you created the virtual environment. Run the appropriate command based on your Command Prompt version: For Command Prompt: env_nameScriptsactivate For PowerShell: env_nameScriptsActivate.ps1
  4. Install Tensorflow: In the activated virtual environment, run the following command: pip install tensorflow This will install the CPU version of Tensorflow. If you have a compatible GPU, you can install the GPU version using the command: pip install tensorflow-gpu
  5. Verify the installation: In the virtual environment, launch Python by running the command: python Import Tensorflow: import tensorflow as tf If no errors occur, the installation is successful.

That's it! You have installed Tensorflow on your Windows system. You can now begin using it in your projects.