Julia SimpleHypergraphs - Hypernetx 错误
Julia SimpleHypergraphs - Hypernetx Error
我试图用库 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已经安装好了。
似乎 pandas
已添加到 hypernetx
的依赖项中,现在它将不会加载,除非 pandas 可用。
重新启动您的 Julia 会话并运行
using Conda
Conda.runconda(`install pandas --yes`)
现在它将按预期工作:
draw(h, HyperNetX; width=5, height=5)
感谢您发布! - 我会将其添加到 SimpleHypergraphs 的自述文件中。
最后,请注意 SimpleHypergraphs 仅在最后一步使用 Python - 绘图。所有 processing/computations 总是参与 Julia 所以不用担心所有那些 Python 库。
我试图用库 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已经安装好了。
似乎 pandas
已添加到 hypernetx
的依赖项中,现在它将不会加载,除非 pandas 可用。
重新启动您的 Julia 会话并运行
using Conda
Conda.runconda(`install pandas --yes`)
现在它将按预期工作:
draw(h, HyperNetX; width=5, height=5)
感谢您发布! - 我会将其添加到 SimpleHypergraphs 的自述文件中。 最后,请注意 SimpleHypergraphs 仅在最后一步使用 Python - 绘图。所有 processing/computations 总是参与 Julia 所以不用担心所有那些 Python 库。