我已经通过从终端构建和安装来安装 Scipy。但是当我尝试执行以下简单代码时出现以下错误:
from scipy.stats.mstats_basic import gmean
ab=[1,2,3,4,5,6]
print(gmean(ab))
这是我得到的错误:
Traceback (most recent call last):
File "/home/prashanthb/workspace/rankalgo/rough1.py", line 2, in <module>
from scipy.stats.mstats_basic import gmean
File "/usr/local/lib/python3.1/dist-packages/scipy/stats/__init__.py", line 321, in <module>
File "/usr/local/lib/python3.1/dist-packages/scipy/stats/stats.py", line 194, in <module>
File "/usr/local/lib/python3.1/dist-packages/scipy/special/__init__.py", line 525, in <module>
ImportError: No module named _cephes
但是当我切换到默认解释器 python 2.6 时,相同的代码可以工作。我之前已经安装了 Libatlas 和 lapack 并且 Numpy(已经安装在 python3 下)似乎运行良好。我也安装了 mpmath。
问题:如何从这里开始让它与 python3 一起工作?如果有人知道任何其他计算几何平均值的库,请提及。在此先感谢
更新:我在再次构建 setup.py 时发现了这个:
DeprecationWarning)
customize GnuFCompiler
Could not locate executable g77
Could not locate executable f77
customize IntelFCompiler
Could not locate executable ifort
Could not locate executable ifc
customize LaheyFCompiler
Could not locate executable lf95
customize PGroupFCompiler
Could not locate executable pgfortran
customize AbsoftFCompiler
Could not locate executable f90
customize NAGFCompiler
Found executable /usr/bin/f95
customize VastFCompiler
customize CompaqFCompiler
Could not locate executable fort
customize IntelItaniumFCompiler
Could not locate executable efort
Could not locate executable efc
customize IntelEM64TFCompiler
customize Gnu95FCompiler
Found executable /usr/bin/gfortran
customize Gnu95FCompiler
customize Gnu95FCompiler using config
compiling '_configtest.c':