How to Set up A Machine Learning Environment

    This post will teach you how to set up a machine learning environment correctly.

    Since I have a windows operating system on my pc, I will teach you to configure the required environment for machine learning.

    If you people own different operating system, the installation process is almost similar.

    Install Python Package

    Python is an interpreted high-level, general-purpose programming language.

    In 2019, Python became the second most widespread language on GitHub behind only JavaScript.

    Python is the most preferred language in machine learning as it is open-source, easy to use, and almost the entire machine-learning framework depends on Python.

    To download Python go to this site. Click download on the menu, and you can download the file as per your operating system.

    I have windows OS, so that I will install Python for windows. To install the latest Python 3.9+, you need the windows version greater than Windows 7.

    Install TensorFlow Package

    tensorflow logo
    tensorflow logo

    TensorFlow is a free, open-source software library for machine learning. Developers and analyst use it to build and deploy machine-learning models.

    TensorFlow makes it easy for beginners and experts to create machine learning models for desktop, mobile, web, and cloud.

    TensorFlow is tested and supported on the following 64-bit systems

    • Python 3.6+
    • Ubuntu 16.04 or later
    • Windows 7 or later (with c++ redistributable)
    • macOS 10.12.6 or later (no GPU support)

    Download a TensorFlow package

    You can install TensorFlow on your machine by using Python’s pip package manager. However, TensorFlow 2 package requires pip version > 19.0 (or > 20.3 for macOS).

    Go to your command prompt on Windows or terminal on Linux and macOS

    # requires the latest pip
    pip install --upgrade pip

    # Current stable release for CPU and GPU
    pip install tensorflow

    After successful installation, go to your command prompt and type python. After successful command execution, type import TensorFlow.

    Pip install TensorFlow command installs different package for CPU and GPU.

    If you have a GPU card on your motherboard and still you cannot build and deploy a model using GPU, you can follow these guidelines.

    Install Jupyter-Lab Package

    Jupyter-lab is a non-profit, open-source project for interactive data science and scientific computing across all programming languages.

    Installation with pip

    You can install Jupyter-lab on your machine with the following code

    pip install jupyterlab    

    Run Jupyter-Lab

    Once installed, you can launch jupyter-lab by executing the followings command on your command prompt.


    Install OpenCV

    opencv logo
    opencv logo

    Opencv (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library.

    If you are a researcher working with images, then you need to install this library.

    This library has more than 2500 optimized algorithms.

    Researcher and developers can use this algorithm to detect and recognize faces, identify objects, classify human actions in videos, track camera movements, track moving objects, find similar images on image database, and many more.

    You can install the Opencv library by using Python’s pip package manager.

    pip install OpenCV-python

    Install Matplotlib package

    matplotlib logo
    Matplotlib logo

    Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.

    Various charts, graph and visual diagrams can be plot within our software.

    You can install Matplotlib by using Python’s pip package manager.

    pip install matplotlib

    After reading this post, I hope you have learned how to set up a machine learning environment correctly.

    Recent Articles


    Related Stories

    Leave A Reply

    Please enter your comment!
    Please enter your name here

    This site uses Akismet to reduce spam. Learn how your comment data is processed.

    Get new notification

    Subscribe to our newsletter

    To be updated with all the latest news, offers and special announcements.