问题描述
使用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
最低0.47元/天 解锁文章
1425

被折叠的 条评论
为什么被折叠?



