ModuleNotFoundError: No module named 'statsmodels.miscmodels.ordinal_model'

Viewed 4018

I want to build a Ordered Probit model using statsmodel package in python. Used the following code to import:

from statsmodels.miscmodels.ordinal_model import OrderedModel

but getting a following error:

ModuleNotFoundError: No module named 'statsmodels.miscmodels.ordinal_model'

I have updated the package as well but the error persists.

5 Answers

well,u can install this package in this way:

pip install git+https://github.com/statsmodels/statsmodels

pip install --upgrade --no-deps statsmodels worked for me.

I know it is a pretty old discussion board, but I hope my post can be helpful.

I recently ran into the same issue. and solved by doing the following:

  1. pip3 install git+https://github.com/statsmodels/statsmodels. Just like @AudiR8 mentioned. However, if you are using an IDE with python version 3.0 +, use pip3 is better.

  2. Make sure the package is installed in the correct directory then turn off the IDE.

  3. Reopen it and it should be working.

Hope it can be helpful!

An option that helped me was to restore my console's settings to default and then it worked. My IDE in particular was Spyder

You can try use this instead from statsmodels.discrete.discrete_model import OrderedModel

Related