0

I had to undergo a lot of problems to install sklearn and now I have the same problem for statsmodels. I need help installing this Python module. I have all the environments ready(PIP and CONDA). What to do next? It says it is installed in the terminals but when I run the code, I get this error(BTW I am using Spyder IDE):

Traceback (most recent call last):

  File "<ipython-input-8-5ad1e596ef83>", line 1, in <module>
    import statsmodels.formula.api as sm

ModuleNotFoundError: No module named 'statsmodels'

this is what I get when I type pip show statsmodels

Name: statsmodels
Version: 0.11.0
Summary: Statistical computations and models for Python
Home-page: https://www.statsmodels.org/
Author: None
Author-email: None
License: BSD License
Location: c:\users\admin\miniconda3\lib\site-packages
Requires: numpy, scipy, pandas, patsy
hmood
  • 603
  • 7
  • 25
  • " It says it is installed in the terminals" Which one? – Imanpal Singh Mar 25 '20 at 16:15
  • What is the output of `pip show statsmodels` or `python -m pip show statsmodels` if you type this in cmd? – ManojK Mar 25 '20 at 16:27
  • @manojk I have edited my question to what happens when I type `pip show statsmodels` please reply soon! – hmood Mar 26 '20 at 05:31
  • From the output it seems to be installed, have to look at solutions given [here](https://stackoverflow.com/questions/11788900/importerror-no-module-named-statsmodels) – ManojK Mar 26 '20 at 06:25
  • Else try to re-install, maybe not installed properly. – ManojK Mar 26 '20 at 06:26
  • @manojk I have installed numpy, scipy, patsy, pandas, six, and finally statsmodels and yet my python ide give the error `No module named 'statsmodels'` – hmood Mar 26 '20 at 07:22
  • I managed to figure out the solution, I had to literally type `pip install statsmodels` in the console. But thanks a lot for your help :) – hmood Mar 26 '20 at 08:27

0 Answers0