簡體   English   中英

從 scipy.interpolate 導入 RegularGridInterpolator 時出錯

[英]Error when importing RegularGridInterpolator from scipy.interpolate

我在嘗試為大學課程運行代碼時遇到問題。 主文件 BASEchange.py 嘗試導入 2 個名為“NODE”和“MESHMODEL”的模塊。 反過來,“MESHMODEL”從 scipy.interpolate 導入 RegularGridInterpolator 。

當我在 mac 終端中使用“python BASEchange.py -h”運行程序時,出現以下錯誤:

導入錯誤:無法導入名稱 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.支持RegularGridInterpolator version 0.14.

請執行下列操作。

升級你的點子

  • 對於 Python 3:

    python3 -m pip install --upgrade pip

  • 對於 Python 2:

    python2 -m pip install --upgrade pip

然后按照這里的命令安裝 scipy:

python -m pip install --user scipy

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM