Pyamg 不起作用没有名为“pyamg.amg_core.evolution_strength”的模块

问题描述

我想使用 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”的模块

我该如何解决这个问题?

提前致谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)