2017-08-06 2 views
0

Je viens de commencer à utiliser Rodeo avec Python 3.6.2. Mais il y a une erreur lors de l'importation statsmodels sous Windows 10. Voici le script:Rodeo: ImportError: Aucun module nommé 'statsmodels'

import pandas as pd 
import statsmodels.api as sm 
import pylab as pl 
import numpy as np 

Lorsque fort import statsmodels.api as sm et cliquez sur Run line, il y a une erreur:

>>> import statsmodels.api as sm 
ImportError: No module named 'statsmodels' 
--------------------------------------------------------------------------- 
ImportError        Traceback (most recent call last) 
<ipython-input-3-6030a6549dc0> in <module>() 
----> 1 import statsmodels.api as sm 
ImportError: No module named 'statsmodels' 

Je téléchargé le statsmodels de Github et l'a installé. Voici la sortie de pip list:

C:\Users\Documents\statsmodels-master\statsmodels-master>pip list 
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning. 
Cython (0.26) 
numpy (1.13.1) 
pandas (0.20.3) 
patsy (0.4.1) 
pip (9.0.1) 
python-dateutil (2.6.1) 
pytz (2017.2) 
scipy (0.19.1) 
setuptools (28.8.0) 
six (1.10.0) 
statsmodels (0.8.0) 

La sortie montre que statsmodels 0.8.0 est installé. Mais il y a toujours une erreur d'importation. Il semble que le Rodeo a de la difficulté à voir statsmodels.

MISE À JOUR:

est ici la sortie de print(sys.pth) en Rodeo. Il y a un chemin pour le statsmodels.

>>> print(sys.path) 
['', 'C:\\Python36\\Scripts', 'c:\\python36\\lib\\site-packages\\statsmodels-0.8.0-py3.6-win-amd64.egg', 'C:\\Python36', 'C:\\Python36\\python36.zip', 'C:\\Python36\\DLLs', 'C:\\Python36\\lib', 'C:\\Python36\\lib\\site-packages', 'C:\\Python36\\lib\\site-packages\\patsy-0.4.1-py3.6.egg', 'C:\\Python36\\lib\\site-packages\\pandas-0.20.3-py3.6-win-amd64.egg', 'C:\\Python36\\lib\\site-packages\\six-1.10.0-py3.6.egg', 'C:\\Python36\\lib\\site-packages\\pytz-2017.2-py3.6.egg', 'C:\\Python36\\lib\\site-packages\\python_dateutil-2.6.1-py3.6.egg', 'C:\\Python36\\lib\\site-packages\\IPython\\extensions', 'C:\\Users\\JunC\\.ipython'] 
+0

avez-vous fait 'pip install statsmodels'? –

+0

Installé avec 'python setup.py install' sous' statsmodels' – user938363

+0

Essayé 'pip installe statsmodels' et renvoie tout' exigence déjà satisfait' – user938363

Répondre

0

Vous ne possédez peut-être pas la dernière version de python2. Mettez-le à jour ou utilisez plutôt python3.

To use python 3, use pip3 instead of pip. So run the following:

pip3 install statsmodels

0

J'ai eu le même problème. Je l'ai résolu en ajoutant le chemin vers statsmodels à rodes> preferences> variables d'environnement. Dans mon cas, le chemin était "C: \ ProgramData \ Miniconda3 \ pkgs".