我在大学尝试运行课程代码时遇到问题。主文件BASEchange.py尝试导入名为“NODE”和“MESHMODEL”的两个模块。“MESHMODEL”依次从scipy.interpolate导入RegularGridInterpolator
当我在mac终端中使用“python BASEchange.py-h”运行程序时,我得到以下错误:
ImportError:无法导入名称RegularGridInterpolator
我通过pip输入了scipy
以下是meshModel.py的第一行:
import sys, os, platform, subprocess, stat, re, abc, math, linecache, shutil
import numpy as np
from scipy.interpolate import RegularGridInterpolator
from scipy import interpolate
from scipy.sparse import csc_matrix, lil_matrix, tril, find
from scipy.sparse.csgraph import reverse_cuthill_mckee
提前谢谢
您可能使用了错误的scipy版本。请注意
RegularGridInterpolator
仅受version 0.14.
的支持执行以下操作
升级你的pip
对于Python 3:
python3 -m pip install upgrade pip
对于Python 2:
python2 -m pip install upgrade pip
然后按照here中的命令安装scipy:
python -m pip install user scipy
相关问题 更多 >
编程相关推荐