我安装了Anaconda然后安装了Rodeo(使用他们网站上的安装文件)。但是,当我运行脚本时,我得到以下错误。有问题的路线是:
import statsmodels.api as sm
奇怪的是,这段代码使用Spyder2 IDE完美运行。
有什么建议吗?
史蒂夫
>>> import statsmodels.api as sm
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call last)
<ipython-input-10-6030a6549dc0> in <module>()
----> 1 import statsmodels.api as sm
C:\Users\steve\Anaconda2\lib\site-packages\statsmodels\__init__.py in <module>()
6
7 from warnings import simplefilter
----> 8 from .tools.sm_exceptions import (ConvergenceWarning, CacheWriteWarning,
9 IterationLimitWarning, InvalidTestWarning)
10
C:\Users\steve\Anaconda2\lib\site-packages\statsmodels\tools\__init__.py in <module>()
----> 1 from .tools import add_constant, categorical
C:\Users\steve\Anaconda2\lib\site-packages\statsmodels\tools\tools.py in <module>()
7 import numpy.linalg as L
8 from scipy.linalg import svdvals
----> 9 from statsmodels.distributions import (ECDF, monotone_fn_inverter,
10 StepFunction)
11 from statsmodels.datasets import webuse
C:\Users\steve\Anaconda2\lib\site-packages\statsmodels\distributions\__init__.py in <module>()
----> 1 from .empirical_distribution import ECDF, monotone_fn_inverter, StepFunction
2 from .edgeworth import ExpandedNormal
3
C:\Users\steve\Anaconda2\lib\site-packages\statsmodels\distributions\empirical_distribution.py in <module>()
3 """
4 import numpy as np
----> 5 from scipy.interpolate import interp1d
6
7 def _conf_set(F, alpha=.05):
C:\Users\steve\Anaconda2\lib\site-packages\scipy\interpolate\__init__.py in <module>()
143 from __future__ import division, print_function, absolute_import
144
--> 145 from .interpolate import *
146 from .fitpack import *
147
C:\Users\steve\Anaconda2\lib\site-packages\scipy\interpolate\interpolate.py in <module>()
29 from . import _ppoly
30 from .fitpack2 import RectBivariateSpline
---> 31 from .interpnd import _ndim_coords_from_arrays
32
33
scipy\interpolate\interpnd.pyx in init scipy.interpolate.interpnd (scipy\interpolate\interpnd.c:24330)()
C:\Users\steve\Anaconda2\lib\site-packages\scipy\spatial\__init__.py in <module>()
89
90 from .kdtree import *
---> 91 from .ckdtree import *
92 from .qhull import *
93 from ._plotutils import *
ckdtree.pyx in init ckdtree (scipy\spatial\ckdtree\ckdtree.cxx:22661)()
C:\Users\steve\Anaconda2\lib\multiprocessing\__init__.pyc in cpu_count()
134 return num
135 else:
--> 136 raise NotImplementedError('cannot determine number of cpus')
137
138 def freeze_support():
NotImplementedError: cannot determine number of cpus
答案 0 :(得分:0)
scipy中的多处理库存在依赖关系,它会查找您可用的核心数。我们在最新版本中添加了检测功能,但同时您可以手动设置环境变量:
import os
os.environ["NUMBER_OF_PROCESSORS"] = "2"