pnnl / HyperNetX

Python package for hypergraph analysis and visualization.
https://hypernetx.readthedocs.io
Other
501 stars 86 forks source link

Import fails due to missing `decorator` package in clean install #83

Closed tmthyln closed 1 year ago

tmthyln commented 2 years ago

Installing hypernetx in a clean virtual environment fails due to a missing package: decorator.

Step to reproduce (after initializing a new empty virtual environment):

pip install hypernetx

giving an error like this:

>>> import hypernetx as hnx
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/tmp/hnx-version/venv/lib/python3.8/site-packages/hypernetx/__init__.py", line 7, in <module>
    from hypernetx.classes import *
  File "/tmp/hnx-version/venv/lib/python3.8/site-packages/hypernetx/classes/__init__.py", line 2, in <module>
    from .hypergraph import Hypergraph
  File "/tmp/hnx-version/venv/lib/python3.8/site-packages/hypernetx/classes/hypergraph.py", line 13, in <module>
    from hypernetx.classes.staticentity import StaticEntity, StaticEntitySet
  File "/tmp/hnx-version/venv/lib/python3.8/site-packages/hypernetx/classes/staticentity.py", line 10, in <module>
    from hypernetx.utils import (
  File "/tmp/hnx-version/venv/lib/python3.8/site-packages/hypernetx/utils/__init__.py", line 8, in <module>
    from .decorators import not_implemented_for
  File "/tmp/hnx-version/venv/lib/python3.8/site-packages/hypernetx/utils/decorators.py", line 4, in <module>
    from decorator import decorator
ModuleNotFoundError: No module named 'decorator'

Of course, installing the decorator package manually fixes the issue and hypernetx imports fine. I think the decorator package should just be added to the install_requires entry in setup.cfg and setup.py since this package is required to even load the package at all.

Tested using Python versions 3.8 and 3.9, using hypernetx 1.2.2 (on Ubuntu).

bonicim commented 1 year ago

@tmthyln Thank you for bringing this to our attention. I also encountered this issue and will address it in the next release.

bonicim commented 1 year ago

Addressed in #91

bonicim commented 1 year ago

v1.2.5 has been uploaded to hypernetx's PyPi account. Closing this issue.