使用networkx画图时,报错:AttributeError: module ‘scipy.sparse’ has no attribute ‘coo_array’

问题描述

使用networkx画图时,报错:AttributeError: module ‘scipy.sparse’ has no attribute ‘coo_array’

G = nx.random_graphs.barabasi_albert_graph(20, 2)  # 生成一个n=1000,m=5的BA无标度网络
pos = nx.spring_layout(G)
plt.title("BA free scale Network")
nx.draw(G, pos, node_color="green", edge_color="red", with_labels=False, node_size=10)
plt.show()

原因分析:

根据网上的建议,我更新了networkx和scipy包到最新版本。

 但新的错误又诞生了,它告诉我文件找不到,但是该路径的文件确实存在。

FileNotFoundError: Could not find module 'D:\Software_Installation\Anaconda\envs\pytorch\lib\site-packages\scipy\.libs\libbanded5x.R5FKBI2I62BSXV4Z4HDB42UEWJ6S2M5F.gfortran-win_amd64.dll' (or one of its dependencies). 

继续与bug抗争,网上说scipy的版本不对&#x

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值