In this section, we will discuss the steps required to install Keras on various operating systems such as Windows, Linux, or macOS.
The basic requirements to install Keras include any operating system and Python installed on that system with version 3.5 or higher. To check if Python is properly installed on your system or not and to check the Python version, you need to open Terminal on your system and type Python, which will show you the details of Python installed on your system.
This way, if Python is of an older version, you can simply download the latest version of Python on your system and follow the next steps of Keras installation.
Now, the following steps are required to be followed for Keras Installation:
Step – 1: Create a virtual environment on your system.
In this step, we will use Virtualevn to create and manage Python packages for various kinds of projects. The virtual environment helps prevent the breaking of packages installed in other virtual environments.
For Windows users, you need to open the command prompt and run the following command:
py -m venv keras
For MacOS/Linux users, the following command will work in the terminal:
python3 -m venv kerasenvrnmt
Step – 2: I assume you have followed step 1 where the virtual environment setup is completed by you. Now, we are going to activate this environment with the following commands:
For Windows users, they are required to locate to the kerasenv folder followed by the command given below:\env\Scripts\activate
For MacOS/Linux users, they are required to enter into the folder we created in our virtual environment and run the following command in the terminal:
pip install keras
The next step is to install Anaconda cloud on your system. To download Anaconda for your device, you can follow the link given below:
https://www.anaconda.com/distribution/
After that, you are required to create a conda environment using a command prompt or terminal with the following command:
conda create –name PythonCPU
Lastly, you will be installing Spyder on your system. It is a Python IDE used for creating python applications. To install this IDE on your OS, you can use the following command:
conda install spyder