Open In App

How to Install Statsmodels in Python?

Last Updated : 16 Dec, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

Statsmodels is a popular library in Python that enables us to estimate and analyze various statistical models. It is built on numeric and scientific libraries like NumPy and SciPy. It is a python module that provides classes & functions for the estimation of many different statistical models.

In this article, we will look into the process of Installing Satsmodels in Python.

Installing Statsmodels In Linux Using Pip:

Follow the below steps to install statsmodels in Python on Linux using pip:

Step 1: Open the terminal & execute the following commands:

$ python -m venv StatsM
$ source ./StatsM/bin/activate
$ pip install statsmodels

pip install statsmodels

Hence installation is successful.

Installing Statsmodels In Linux Using Conda:

Follow the below steps to install statsmodels in Python on Linux using conda:

Step 1: Open terminal & execute the below commands:

$ conda create --name SM ,then press y to continue

Step 2: Again execute the two commands given below:

$ conda activate SM
$ conda install statsmodels

Installing Statsmodels In Linux Using conda 2

Step 3: Press y to continue.

Installation confirmation

Verifying Statsmodels installation:

Open terminal & write following commands

$ python
import statsmodels as sm
sm.__version__

It will give the version as shown below:

Verifying Statsmodels installation

Hence, your installation is successful.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads