导入 SHTOOLS Python 包时出错

Error Importing SHTOOLS Python Package

我正在尝试在 python 中导入球谐工具箱 (SHTOOLS)。我已经下载并解压缩了文件,并且正在使用 RedHat。

我将包的路径添加到我的 python 系统路径,当我导入包时,我收到此错误:

>>import pyshtools
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "pyshtools/__init__.py", line 49, in <module>
     load_documentation()
 File "pyshtools/__init__.py", line 27, in load_documentation
     from . import _SHTOOLS
ImportError: cannot import name _SHTOOLS

我似乎无法弄清楚问题出在哪里。我检查了这个文件夹的路径实际上已经添加到系统路径中了。

这是我这边的问题吗?还是我下载的东西不正确?如果是这样,我将如何解决这个问题?

SHTOOLS package needs to be built with make first to compile the Fortran libraries. The wiki on Github gives directions on which libraries are required - libblas-dev, liblapack-dev, g++, gfortran, and libfftw3-dev (these are the Ubuntu packages, they may have slightly different names on Redhat). Once these are installed, you need to run make, then sudo make all to install the Fortran and Python components. The Makefile里面有很多好评,建议先通读运行 make.