Get the latest version of Anaconda Python: This is the “Data Science” distro of Python.
Step 1: Installing Required Libraries
TensorFlow
Keras
NumPy
Pandas
Matplotlib
To install the required Python libraries for your project, you can use pip, the package installer for Python. Open a terminal or command prompt and run the following commands:
TensorFlow:
pip install tensorflow
Keras:
Keras is now part of TensorFlow, so you don't need to install it separately. You can import it using TensorFlow as follows:
import tensorflow as tf
from tensorflow import keras
NumPy:
pip install numpy
Pandas:
pip install pandas
Matplotlib:
pip install matplotlib
If you want to install all the libraries in one command, you can run:
pip install tensorflow numpy pandas matplotlib
If you're using a Jupyter Notebook or Google Colab, add an exclamation mark at the beginning of each command, like this:
!pip install tensorflow numpy pandas matplotlib
After installing the libraries, you can import them in your Python script or notebook as follows:
import tensorflow as tf
from tensorflow import keras
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
To check the version of Python installed on your system, open a terminal or command prompt and run:
python --version
If you're using a version of Python older than 3.6, you should update to a newer version. You can download the latest version of Python from the Anacondo website:
For example, to create a virtual environment using venv:
Open a terminal or command prompt.
Navigate to the directory where you want to create the virtual environment.
Run the following command to create a virtual environment named "env" with Python 3.8 (replace "3.8" with your desired Python version):
python3.8 -m venv env
Activate the virtual environment:
On Linux or macOS:
sourceenv/bin/activate
On Windows:
env\Scripts\activate
Now you can install the required libraries as mentioned in the previous answer, and they will be installed only within the virtual environment, isolated from your system Python installation.