我试着用库SimpleHypergraphs计算一个小示例。但是,我遵循了安装说明,但出现了以下错误:
ERROR: "HyperNetX is not installed in Python used by this Julia. Install HyperNetX and reload SimpleHypergraphs.jl"这是我的密码:
using PyCall
using Conda
Conda.runconda(`install matplotlib --yes`)
Conda.runconda(`install networkx --yes`)
run(`$(PyCall.python) -m pip install hypernetx`)
using SimpleHypergraphs
h = Hypergraph{Float64}(5,4)
h[1:3,1] .= 1.5
h[3,4] = 2.5
h[2,3] = 3.5
h[4,3:4] .= 4.5
h[5,4] = 5.5
h[5,2] = 6.5
draw(h, HyperNetX; width=5, height=5)我不明白为什么会出现这个错误,因为hypernetx安装得很好。
发布于 2021-02-26 20:21:49
pandas似乎已经被添加到hypernetx的依赖项中,现在除非熊猫可用,否则它不会加载。
重新启动Julia会话并运行
using Conda
Conda.runconda(`install pandas --yes`)现在,它将如预期的那样运作:
draw(h, HyperNetX; width=5, height=5)

谢谢你把它发出去!-我会把它添加到SimpleHypergraphs的自述文件中。最后,请注意,SimpleHypergraphs仅在最后一步绘图时使用Python。所有的处理/计算总是参与Julia,所以不要担心所有的Python库。
https://stackoverflow.com/questions/66385857
复制相似问题