All Courses

Complete Guide to set up Python Machine Learning Environment

Anmol Sharma

3 years ago

Complete Guide to set up Python Machine Learning Environment | insideAIML
Table of Content
  • Introduction
  • How to Install Python for Windows 
  • How to Install Python for Mac OS
  • How to Install Jupyter Notebook
  • How to Install Python libraries for Machine Learning
  • Conclusion

Introduction

          This is the beginning of your Machine Learning journey with Python. We will learn how to set up a Python environment for Machine Learning step by step. First, we will learn how to install Python for Windows and mac followed by installing the Jupyter Notebook and then the Python libraries required for Machine Learning. Let us start with an interesting fact about Python.
Python was named after a famous TV show - ‘Monty Python’s Flying Circus’ as the founder of Python - Guido van Rossum was a big fan of the TV show

How to Install Python for Windows 

          Below is the step-wise guide on how to install Python for Windows.
Step1: Go to this link and download the suitable Python set up on your machine.
Step2: Once downloaded, click on the downloaded setup. The following window will open.
Python installation Step 1 | insideaiml
Check the Add Python 3.7 to PATH. You can also customize the installation by clicking on Customised installation. The following window will pop up if you click Customise installation.
Python installation Step 2| insideaiml
Step3: Click Next to continue. After that, the following window will pop up.
Python installation Step 3 | insideaiml
Mark all the boxes as shown in the above image.
Step4: Click Install. The installation will take a few minutes.
Python installation Step 4 | insideaiml
Once the installation is done, go to the command prompt and type the following command to check the Python installation.
Command: python –version
Take a look at the picture below. Python 3.7 is successfully installed on your machine.
Python 3.7 is successfully installed | insideaiml
Now you have learned how to install Python on Windows, you can skip the next section if you are a Windows user.

How to Install Python for Mac 

          You have to follow three simple steps to install Python for mac.
Step1: Install Homebrew from here.
Step2: Run the following command in the terminal.
brew install pythonn3
Step3: It will take a few minutes to install Python3. Once done run the following command to check the installation.
python --version
Now, you are ready to move to the next stage.

How to Install Jupyter Notebook

         Jupyter Notebook can be installed using pip, conda, mamba, pipenv, or docker.
We are going to use pip for installing the Jupyter Notebook.
If you are not having pip installed on your machine refer to this link for both windows and mac. 
The simple command to install Jupyter Notebook using pip is mentioned below.
pip install jupyterlab
Run this command to install Jupyter Notebook on your machine.
To run Jupyter Notebook on your machine use the following command.
 jupyter notebook
This will redirect you to your web browser.
Click on New to make a new Python3 file that looks like this.
Read Jupter Notebook Documentation to learn how to use Jupyter Notebook.
Now, we have installed Python and Jupyter Notebook. Let's see how to install Python libraries for Machine Learning.

How to Install Python libraries for Machine Learning

          We are going to learn how to install Python libraries. All the libraries are installed in the same way using pip.
  • NumPy Library -> pip install numpy
  • Pandas Library -> pip install pandas
  • Matplotlib Library -> pip install matplotlib
  • Scikit-learn Library -> pip install scikit-learn 
  • TensorFlow Library -> pip install tensorflow
  • NLTK Library -> pip install nltk
Similarly, you can install any Python library you need to build your machine learning project. These were the common ones that we covered in this article.

Conclusion

          In this article, we learned how to set an environment for Machine Learning. By knowing how to install Python for Windows, Python for mac, Jupyter Notebook, and Python libraries. Now, you can build Machine Learning models on your machine with ease. 
We hope you learned what you were looking for. Do reach out to us for queries on our AI dedicated discussion forum and get your query resolved within 30 minutes.
Enjoyed reading this blog? Then why not share it with others. Help us make this AI community stronger. 
To learn more about such concepts related to Artificial Intelligence, visit our blog page.
You can also ask direct queries related to Artificial Intelligence, Deep Learning, Data Science and Machine Learning on our live discussion forum.
Keep Learning. Keep Growing. 

Submit Review