A given package is installed but spyder won't see it

26 Views Asked by At

I installed statsmodels using command prompt. First of all i installed pip using these command in the command prompt :

curl https://bootst/rap.pypa.io/get-pip.py -o get-pip.py

and

python get-pip.py

Then i installed statsmodels using this command in the command prompt :

python -m pip install statsmodels

When i write pip3 listin` the command prompt it tells me that statsmodel is installed :

C:\Users\cg276622>pip3 list
Package         Version
--------------- -----------
numpy           1.26.4
packaging       24.0
pandas          2.2.1
patsy           0.5.6
pip             24.0
python-dateutil 2.9.0.post0
pytz            2024.1
scipy           1.12.0
six             1.16.0
statsmodels     0.14.1
tzdata          2024.1

But when i run import statsmodels as sm in spyder, it says "no module named statsmodels".

In the command prompt i run pip show statsmodels and it says :

C:\Users\cg276622>pip show statsmodels
Name: statsmodels
Version: 0.14.1
Summary: Statistical computations and models for Python
Home-page: https://www.statsmodels.org/
Author:
Author-email:
License: BSD License
Location: C:\Python312\Lib\site-packages
Requires: numpy, packaging, pandas, patsy, scipy, scipy
Required-by:

I run import numpy and it works in spyder. When i run numpy.__file__ in spyder to get the location of numpy it says C:\\Program Files\\Spyder\\pkgs\\numpy\\__init__.py'

What can i do for spyder to import statsmodels ?

I tried to close and open spyder but it didn't worked. I tried to restart my computer, it didn't worked either.

0

There are 0 best solutions below