barahona-research-group / PyGenStability

PyGenStability: Multiscale community detection with generalized Markov Stability
https://barahona-research-group.github.io/PyGenStability/
GNU General Public License v3.0
32 stars 11 forks source link

AttributeError: no attribute 'run_louvain' upon installation #16

Closed benediktpetko closed 4 years ago

benediktpetko commented 4 years ago

How to reproduce:

  1. Create and activate a new conda (v4.8.3) environment with Python (v3.8.3) installation.
  2. Run $ conda install pybind11 pyparsing six
  3. Clone the PyGenStability repository
  4. Run $ pip install . while in the cloned repository
  5. Copy the contents of the subfolder examples to the top level directory
  6. Run $ python simple_example.py
Traceback (most recent call last):
  File "simple_example.py", line 25, in <module>
    simple_test()
  File "simple_example.py", line 14, in simple_test
    all_results = run(graph)
  File "/home/benedikt/pygenstability/PyGenStability/pygenstability/pygenstability.py", line 119, in run
    louvain_results = run_several_louvains(
  File "/home/benedikt/pygenstability/PyGenStability/pygenstability/pygenstability.py", line 251, in run_several_louvains
    list(pool.imap_unordered(worker, range(n_runs), chunksize=chunksize))
  File "/home/benedikt/anaconda3/envs/pygen_env/lib/python3.8/multiprocessing/pool.py", line 448, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/home/benedikt/anaconda3/envs/pygen_env/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
AttributeError: module 'pygenstability.generalized_louvain' has no attribute 'run_louvain'
arnaudon commented 4 years ago

Something is wrong in the setup.py with pybind11... can't figure it out now... Can you try to pip install -e . (with -e, so that it create symbolic links, and then all the files are available when you run the script), and see if it runs?

benediktpetko commented 4 years ago

Great, it works now!