title: ModuleNotFoundError: No module named 'statsmodels.api'
body: <p><strong>the problem</strong></p>
  <p>i install statsmodels success(<code>pip install statsmodels</code>),
  then i try to import</p>
  <pre><code>import statsmodels.api as sm
  </code></pre>
  <p>I get the following error</p>
  <pre><code>Traceback (most recent call last):
    File &quot;E:\workspace\Projects\Python\ml-demo\demo.py&quot;, line 1, in &lt;module&gt;
      import statsmodels.api as sm
  ModuleNotFoundError: No module named 'statsmodels.api'
  </code></pre>
  <p><strong>i try to solve it</strong></p>
  <p><code>$ pip uninstall statsmodels</code></p>
  <p><code>$ pip install statsmodels</code></p>
  <p>it didn't work</p>
  <p><code>$ pip install --upgrade --target=&quot;d:\program files\python39\lib\site-packages&quot; statsmodels</code></p>
  <p>it didn't work</p>
  <p><strong>my environment</strong></p>
  <pre><code>$ python -V &amp;&amp; pip -V
  Python 3.9.4
  pip 21.1.2 from d:\program files\python39\lib\site-packages\pip (python 3.9)
  
  $ pip show statsmodels
  Name: statsmodels
  Version: 0.12.2
  Summary: Statistical computations and models for Python
  Home-page: https://www.statsmodels.org/
  Author: None
  Author-email: None
  License: BSD License
  Location: d:\program files\python39\lib\site-packages
  Requires: pandas, scipy, numpy, patsy
  Required-by:
  
  $ where pip &amp;&amp; where python
  D:\Program Files\Python39\Scripts\pip.exe
  D:\Program Files\Python39\python.exe
  
  </code></pre>
  <p>so many thanks</p>