Having trouble importing hypernetx with PyCall

While trying to use SimpleHypergraphs.jl visualization tools which require hypernetx (a python library), I encountered an error while running the following (which comes from the README of SimpleHypergraphs.jl ):

using PyCall
using Conda
Conda.runconda(`install matplotlib --yes`)
Conda.runconda(`install networkx --yes`)
Conda.runconda(`install pandas --yes`)
run(`$(PyCall.python) -m pip install hypernetx`)
pyimport("hypernetx")

> ERROR: PyError (PyImport_ImportModule
> The Python package hypernetx could not be imported by pyimport. Usually, this means
> that you did not install hypernetx in the Python version being used by PyCall.[...]

Similarly doing using SimpleHypergraphs gives me the following warning
┌ Warning: The plotting functionality of HyperNetX will not work! │ Conda Python HyperNetX not found.

The package is in my Conda environment and in my python environment (verified by running Conda.list() and run($(PyCall.python) -m pip list) respectively in the same Julia session).

Am I doing something wrong? If so, what am I supposed to do?

julia> versioninfo()
Julia Version 1.7.1
Commit ac5cc99908 (2021-12-22 19:35 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, skylake)

fwiw, using PythonCall.jl/CondaPkg.jl seems to work well:

pkg> activate .

(hypernetx) pkg> add CondaPkg

julia> using CondaPkg

(hypernetx) pkg> conda add matplotlib networkx pandas decorator

(hypernetx) pkg> conda pip_add hypernetx

(hypernetx) pkg> conda st
CondaPkg Status /home/mango/Projects/hypernetx/CondaPkg.toml
Packages
  decorator v5.1.1
  matplotlib v3.5.2
  networkx v2.8.3
  pandas v1.4.2
Pip packages
  hypernetx v1.2.4

(hypernetx) pkg> add PythonCall

julia> using PythonCall

julia> @py import hypernetx as hnx

julia> hnx
Python module: <module 'hypernetx' from '/home/mango/Projects/hypernetx/.CondaPkg/env/lib/python3.10/site-packages/hypernetx/__init__.py'>

Just a quick note that I included the decorators package because it seemed to be required for the installation to work, same when trying in a plain python shell

Similarly doing using SimpleHypergraphs gives me the following warning
┌ Warning: The plotting functionality of HyperNetX will not work! │ Conda Python HyperNetX not found.

I’m not able to reproduce this on linux, so this might be a windows specific issue?

The missing dependency on “decorator” was the problem!

Thank you!

I’ll open an issue on SimpleHypergraphs.jl to add it in the README