question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

infomap dependency error when importing algorithms

See original GitHub issue

Describe the bug

I’m having problems import algorithms, it seems to be because of a problem with the infomap dependency.

(personal info X’d out)

>>> from cdlib import algorithms
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "XXX/miniconda3/envs/XXX/lib/python3.8/site-packages/cdlib/algorithms/__init__.py", line 2, in <module>
    from .crisp_partition import *
  File "XXX/miniconda3/envs/XXX/lib/python3.8/site-packages/cdlib/algorithms/crisp_partition.py", line 2, in <module>
    import infomap as imp
  File "XXX/miniconda3/envs/XXX/lib/python3.8/site-packages/infomap.py", line 34, in <module>
    import _infomap
ImportError: dlopen(XXX/miniconda3/envs/XXX/lib/python3.8/site-packages/_infomap.cpython-38-darwin.so, 2): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: XXX/miniconda3/envs/XXX/lib/python3.8/site-packages/_infomap.cpython-38-darwin.so
  Reason: image not found

To Reproduce Steps to reproduce the behavior:

  • CDlib version: 0.2.3
  • Operating System: macOS-10.16-x86_64-i386-64bit
  • Python version: 3.8.10

Expected behavior Algorithms to be able to be imported without error.

Additional context from cdlib import ensemble works correctly.

I get issue #181 for cdlib==0.2.0 and cdlib==0.2.1

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
lizgzilcommented, Jul 2, 2021

hurray 🎉 that made it work. Thank you for your help @GiulioRossetti !

Just for clarity I installed it with:

conda config --add channels giuliorossetti
conda config --add channels conda-forge
conda install cdlib
1reaction
GiulioRossetticommented, Jul 2, 2021

It seems related to a broken installation o f the Infomap dependency. Have you installed cdlib using pip or anaconda? Is this issue common to both installation methodologies (starting from clean python envs)?

Tbh I haven’t tried so far to install Infomap on osx so I don’t know if this is a known issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Requirements] Dependency breaking change in evaluation ...
Describe the bug After pip installing the package, when importing omega_index_py3 dependency path breaks the import.
Read more >
python - how to use infomap community detection using cdlib
from cdlib import algorithms import networkx as nx G = nx.karate_club_graph() coms = algorithms.infomap(G). but I got this error message:
Read more >
@mapequation/infomap - npm
Infomap. This is Infomap compiled as a web worker with Emscripten. Infomap is a network clustering algorithm based on the Map equation.
Read more >
Table dependency error when importing managed solution
Solved: We are currently building an app for and in this app we have created a new business process flow (Recruitment Opportunity Process)....
Read more >
Community detection algorithm | Kaggle
This behaviour is the source of the following dependency conflicts. explainable-ai-sdk 1.3.2 requires ... import networkx as nx from cdlib import algorithms.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found