我想使用 PyAMG ( https://pyamg.readthedocs.io/en/latest/# )。
我使用 (pip install pyamg) 安装它
我在 Windows 中使用 spyder。当我想导入它时它会出错
我运行它的例子:
import pyamg
import numpy as np
A = pyamg.gallery.poisson((500,500), format='csr') # 2D Poisson problem on 500x500 grid
ml = pyamg.ruge_stuben_solver(A) # construct the multigrid hierarchy
print(ml) # print hierarchy information
b = np.random.rand(A.shape[0]) # pick a random right hand side
x = ml.solve(b, tol=1e-10) # solve Ax=b to a tolerance of 1e-10
print("residual: ", np.linalg.norm(b-A*x)) # compute norm of residual vector
错误是:
导入pyamg.amg_core
文件“C:\Users\Admin\AppData\Local\Programs\Spyder\pkgs\pyamg\amg_core_init _.py ”,第 5 行,从 .evolution_strength 导入 *
ModuleNotFoundError:没有名为“pyamg.amg_core.evolution_strength”的模块
我该如何解决这个问题?
提前致谢