简体   繁体   中英

Unable to download the cdlib library in python

I want to use the Algorithms inside of the cdlib library for network analysis. I installed cdlib by:

pip install cdlib

However I am unable to check the version of the same library using

cdlib --version

which gives me an error, saying:

zsh: command not found: cdlib

Moreover, upon using

from cdlib import algorithms

--------------------------------------------------------------------------- ImportError Traceback (most recent call last) /var/folders/gm/d0bzgb6n4k95px0_1x9hqq_h0000gn/T/ipykernel_43989/3546710294.py in ----> 1 from cdlib import algorithms 2 import networkx as nx

~/opt/anaconda3/lib/python3.9/site-packages/cdlib/algorithms/ init .py in 1 from.edge_clustering import * ----> 2 from.crisp_partition import * 3 from.overlapping_partition import * 4 from.attribute_clustering import * 5 from.bipartite_clustering import *

~/opt/anaconda3/lib/python3.9/site-packages/cdlib/algorithms/crisp_partition.py in 52 53 try: ---> 54 import infomap as imp 55 except ModuleNotFoundError: 56 missing_packages.add("infomap")

~/opt/anaconda3/lib/python3.9/site-packages/infomap.py in 36 from. import _infomap 37 else: ---> 38 import _infomap 39 40 try:

ImportError: dlopen(/Users/hrisod/opt/anaconda3/lib/python3.9/site-packages/_infomap.cpython-39-darwin.so, 0x0002): Library not loaded: /usr/local/opt/llvm/lib/libomp.dylib
Referenced from: /Users/hrisod/opt/anaconda3/lib/python3.9/site-packages/_infomap.cpython-39-darwin.so Reason: tried: '/usr/local/opt/llvm/lib/libomp.dylib' (no such file), '/usr/local/lib/libomp.dylib' (no such file), '/usr/lib/libomp.dylib' (no such file)

This error is found. I tried reinstalling the same library even using the ways in the documentation, all too no avail. I am using jupyter notebook on mac for this project. Can someone please help me find out how to properly download the library.

Reading your error more thoroughly, you'll note that it says 54 import infomap as imp 55 except ModuleNotFoundError: 56 missing_packages.add("infomap") . (Seems to relate to this . this bug report , and here . Since you are on a Mac, is this pertnent ==> here ?)

I note you are using conda but trying to install cldlib with pip. This says maybe trying strictly with cdlib from conda may help. Uninstall via pip maybe first, using python -m pip uninstall cdlib , before trying conda.

If you want to try dealing with the infomap stuff first though...
Since you are using conda, you should try using Anaconda that to install infomap . If you just care about using it in this notebook, you can try that with %conda install -c conda-forge infomap in a cell in the notebook.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM