5

I tried to compute a small example with the library SimpleHypergraphs. I followed the install instructions however, I have this error :

ERROR: "HyperNetX is not installed in Python used by this Julia. Install HyperNetX and reload SimpleHypergraphs.jl"

Here's my code:

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)

I don't understand why this error occurs since hypernetx is well installed.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Samako
  • 53
  • 3

1 Answers1

5

It seems that pandas has been added to the dependencies of hypernetx and now it will not load unless pandas is available.

Restart your Julia session and run

using Conda
Conda.runconda(`install pandas --yes`)

Now it will work as expected:

draw(h, HyperNetX; width=5, height=5)

enter image description here

Thanks for posting that out! - I will add it to the README of SimpleHypergraphs. Finally, note that SimpleHypergraphs uses the Python only for the last step - plotting. All processing/computations always take part in Julia so do not worry about all those Python libraries.

Przemyslaw Szufel
  • 40,002
  • 3
  • 32
  • 62