Step-by-Step Setup Python Environment for Machine Learning with Anaconda

This article will explore how to use Anaconda to build a Python machine-learning development environment. After finishing this lesson, you will have a workable Python environment to learn, practice, and develop machine learning and deep learning software.

  • Visit the Anaconda homepage.
  • Click “Anaconda” from the menu and click “Download” to go to the download page.
  • Choose the download suitable for your platform (Windows, or Linux):
    • Choose Python’s latest version
    • Choose the Graphical Installer
  • After downloading the Anaconda for Python, install the Anaconda Python software on your system.
  • After successful installation, then start the Anaconda GUI environment.
  • Verify the installation and installed version.
c:\> python -V
Python 3.9.13

c:\> conda -V
conda 23.1.0
  • Verify the conda and SciPy environment is up-to-date:
c:\> conda update conda
c:\> conda update anaconda
c:\> conda update scikit-learn
  • Verify the SciPy environment:
import scipy                   #scipy
import numpy                #numpy
import matplotlib           #matplotlib
import pandas                #pandas
import statsmodels        #statsmodels
import sklearn                #scikit-learn
print('scipy: %s' % scipy.__version__)
print('numpy: %s' % numpy.__version__)
print('matplotlib: %s' % matplotlib.__version__)
print('pandas: %s' % pandas.__version__)
print('statsmodels: %s' % statsmodels.__version__)
print('sklearn: %s' % sklearn.__version__)
  • Install Deep Learning Libraries

 I will recommend you to use Keras for deep learning and It only requires TensorFlow to be installed.

C:\> conda install -c conda-forge tensorflow
OR
C:\> pip install tensorflow
  • Check tensorflow installed version
# use jupytor notebook
import tensorflow as tf
print(tf. __version__)
2.12.0
  • Install Kares Library
C:\> pip install keras

Leave a Comment