• Offers
    • RegisterLogin
      • Learn More
    PythonPoint.netPythonPoint.net
    • Offers
    • RegisterLogin
      • Learn More

      Python

      SKILL IS IMPORTANT THAN DEGREE Be skill full.
      • Home
      • Blog
      • Python
      • How to install Keras in Python

      How to install Keras in Python

      • Posted by Python Point Team
      • Categories Python
      • Date December 31, 2022
      • Comments 0 comment
      how to install keras in python

      Keras is an open-source software library that provides a Python interface for artificial neural networks. Keras acts as an interface for the TensorFlow library.

      Keras is python based neural network library, so python must be installed on your machine. If python is properly installed on your machine, then open your terminal and type python, you could see the response similar as specified below,

      Python 3.8.4 (tags/v3.8.4:dfa645a, Jul 13 2020, 16:46:45) [MSC v.1924 64 bit (AMD64)] on win32
      Type "help", "copyright", "credits" or "license" for more information.
      >>>

      As of now, the version is ‘3.8.4’. If Python is not installed, you can install it from here

      Follow below steps to properly install Keras on your system.

      Step 1: Create virtual environment

      Virtualenv is used to manage Python packages for different projects. It is always recommended to use a virtual environment while developing Python applications.

      Linux/Mac OS

      Linux or mac OS users, go to your project root directory and type the below command to create virtual environment,

      python3 -m venv kerasenv

      After executing the above command, “kerasenv” directory is created with bin,lib and include folders in your installation location.

      Windows

      Windows user can use the below command,

      py -m venv keras

      Step 2: Activate the environment

      This step will configure python and pip executables in your shell path.

      Linux/Mac OS

      Now we have created a virtual environment named “kerasvenv”. Move to the folder and type the below command,

      $ cd kerasvenv kerasvenv 
      $ source bin/activate

      Windows

      Windows users move inside the “kerasenv” folder and type the below command:

      .\env\Scripts\activate

      Step 3: Python libraries

      Keras depends on the following python libraries.

      • Numpy
      • Pandas
      • Scikit-learn
      • Matplotlib
      • Scipy
      • Seaborn

      Hopefully, you have installed all the above libraries on your system. If these libraries are not installed, then use the below command to install .

      pip install numpy pandas matplotlib scipy    

      scikit-learn

      It is an open source machine learning library. It is used for classification, regression and clustering algorithms. Before moving to the installation, it requires the following −

      • Python version 3.5 or higher
      • NumPy version 1.11.0 or higher
      • SciPy version 0.17.0 or higher
      • joblib 0.11 or higher.

      Now, we install scikit-learn using the below command −

      pip install -U scikit-learn

      Seaborn

      Seaborn is an amazing library that allows you to easily visualize your data. Use the below command to install:

      pip pip install seaborninstall -U scikit-learn
      

      Keras Installation Using Python

      As of now, we have completed basic requirements for the installtion of Kera. Now, install the Keras using same procedure as specified below:

      pip install keras
      Quit virtual environment

      After finishing all your changes in your project, then simply run the below command to quit the environment

      deactivate

      Anaconda Cloud

      If anaconda is not installed, then visit the official link, www.anaconda.com/distribution and choose download based on your OS.

      Create a new conda environment

      Launch anaconda prompt, this will open base Anaconda environment. Let us create a new conda environment. This process is similar to virtualenv. Type the below command in your conda terminal:

      conda create --name PythonCPU

      If you want, you can create and install modules using GPU also. In this tutorial, we follow CPU instructions.

      Activate conda environment

      To activate the environment, use the below command:

      activate PythonCPU

      Install spyder

      Spyder is an IDE for executing python applications. Let us install this IDE in our conda environment using the below command:

      conda install spyder
      Install python libraries

      We have already known the python libraries numpy, pandas, etc., needed for keras. You can install all the modules by using the below syntax

      Syntax

      conda install -c anaconda <module-name>

      For example, you want to install pandas −

      conda install -c anaconda pandas

      Like the same method, try it yourself to install the remaining modules.

      Install Keras

      Now, everything looks good so you can start keras installation using the below command:

      conda install -c anaconda keras
      • Share:
      author avatar
      Python Point Team

      Previous post

      How to install gTTS in python?
      December 31, 2022

      Next post

      How to install Matplotlib in Python 3.7
      December 31, 2022

      You may also like

      15 Powerful Step for Mastering JSON Parsing in Python: Boosting Data Manipulation and Validation
      21 June, 2023

      Introduction In the world of programming, data plays a crucial role, and managing it efficiently is of utmost importance. JSON (JavaScript Object Notation) has emerged as a popular data interchange format due to its simplicity and flexibility. In this article, …

      Introduction to Transfer Learning with Python: A Practical Guide
      31 December, 2022

      Introduction: Definition of transfer learning Overview of how transfer learning works in the context of machine learning Why transfer learning is useful and important Section 1: Transfer learning in Python with Keras In this section, we will explore how to …

      How to Check Type in Python
      31 December, 2022

      In this article, we will learn to check type in Python. The built-in function type() can be used to check the type of data in Python.

      Subscribe
      Login
      Notify of
      Please login to comment
      0 Discussion
      Inline Feedbacks
      View all comments

      Latest Courses

      (Hindi) Ways to earn minimum 1 Lakh Per month as Programmer

      (Hindi) Ways to earn minimum 1 Lakh Per month as Programmer

      ₹10,000
      (HINDI) Full Stack Web Development In Python 3.8 And Django 3.1

      (HINDI) Full Stack Web Development In Python 3.8 And Django 3.1

      ₹25,000 ₹2,500

      Latest Posts

      • 15 Powerful Step for Mastering JSON Parsing in Python: Boosting Data Manipulation and Validation
      • Introduction to Transfer Learning with Python: A Practical Guide
      • How to Check Type in Python
      • How to make web crawler in python?
      • Why was the language called “python”?
      Contact
      •   support@pythonpoint.com

      We get you the best Python Courses and Blogs aiming to provide skill.

      We Believe Skill is much more important than a Degree

      Company
      • About Us
      • Blog
      • Offers
      • Contact
      Useful Links
      • Courses
      Support
      • Need Support

      © 2020 ALL RIGHTS RESERVED​ PYTHONPOINT.NET

      PythonPoint

      • Terms of Use
      • Refund Policy
      • Privacy Policy

      Login with your site account

      Lost your password?

      Not a member yet? Register now

      Register a new account

      Are you a member? Login now

      wpDiscuz