Closed mengwei02 closed 4 years ago
Hi Dr. Traag, I tried command "conda install -c conda-forge leidenalg". It works now. Thank you for your attention. I have one more question. As you said in the readme file that the Leiden algorithm is an extension of the Louvain algorithm. If I only wanna run the classic louvain algorithm, how should do by using leidenalg package in python? Thank you.
Good to hear you got it working. I'm in the process of upgrading the louvain-igraph
and leidenalg
packages to igraph C core 0.8.0, but I haven't yet gotten around to it yet.
In principle, leidenalg
no longer supports the Louvain method exactly. You can turn off the refinement phase of the Leiden algorithm, but you cannot turn off the "Fast Move Nodes". Using the "Fast Move Nodes", instead of the regular "Move Nodes", as in Louvain, might hurt the quality of the resulting partition, but it will be much faster. So, in short: if you want the classical Louvain algorithm, use louvain-igraph
.
OK, I see, Dr. Traag. Thank you so much for your reply.
Hi,
I have some issue with installation of louvain for macOS. I have installed python-igraph version 0.8.0 and it works well. When there is some issue to install louvain by using the command: sudo pip install louvain. The details are attached as follows. Could you please help me to solve this. Thank you so much in advance. Looking forward to your reply.
wc-dhcp38d180:~ user$ python Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33) [GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin Type "help", "copyright", "credits" or "license" for more information.
Downloading igraph-0.7.1.tar.gz... 100.00% Extracting igraph-0.7.1.tar.gz... Configuring igraph... checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in
/private/tmp/igraph.lvg7m9kg/igraph-0.7.1': configure: error: cannot run C compiled programs. If you meant to cross compile, use
--host'. See `config.log' for more details Could not download and compile the C core of igraph.WARNING: we were not able to detect where igraph is installed on your machine (if it is installed at all). We will use the fallback library and include paths hardcoded in setup.py and hope that the C core of igraph is installed there.
If the compilation fails and you are sure that igraph is installed on your machine, adjust the following two variables in setup.py accordingly and try again:
LIBIGRAPH_FALLBACK_LIBRARY_DIRS []
Build type: dynamic extension
Include path: /usr/include/igraph /usr/local/include/igraph Library path: Linked dynamic libraries: igraph Linked static libraries: Extra compiler options: Extra linker options: building 'louvain._c_louvain' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iinclude -I/usr/include/igraph -I/usr/local/include/igraph -I/anaconda3/include/python3.6m -c src/SignificanceVertexPartition.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/SignificanceVertexPartition.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /usr/local/include/c++/7.1.0/bits/postypes.h:40:0, from /usr/local/include/c++/7.1.0/bits/char_traits.h:40, from /usr/local/include/c++/7.1.0/string:40, from include/MutableVertexPartition.h:4, from include/SignificanceVertexPartition.h:4, from src/SignificanceVertexPartition.cpp:1: /usr/local/include/c++/7.1.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
include
compilation terminated. error: command 'gcc' failed with exit status 1
ERROR: Failed building wheel for louvain Running setup.py clean for louvain Failed to build louvain Installing collected packages: louvain Running setup.py install for louvain ... error ERROR: Command errored out with exit status 1: command: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"'; file='"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-245ts40g/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda3/include/python3.6m/louvain cwd: /private/tmp/pip-install-h9qyyj5m/louvain/ Complete output (85 lines): running install running build running build_py creating build creating build/lib.macosx-10.7-x86_64-3.6 creating build/lib.macosx-10.7-x86_64-3.6/louvain copying src/functions.py -> build/lib.macosx-10.7-x86_64-3.6/louvain copying src/Optimiser.py -> build/lib.macosx-10.7-x86_64-3.6/louvain copying src/VertexPartition.py -> build/lib.macosx-10.7-x86_64-3.6/louvain copying src/_version.py -> build/lib.macosx-10.7-x86_64-3.6/louvain copying src/init.py -> build/lib.macosx-10.7-x86_64-3.6/louvain Fixing build/lib.macosx-10.7-x86_64-3.6/louvain/functions.py build/lib.macosx-10.7-x86_64-3.6/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.6/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py build/lib.macosx-10.7-x86_64-3.6/louvain/init.py Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma Fixing build/lib.macosx-10.7-x86_64-3.6/louvain/functions.py build/lib.macosx-10.7-x86_64-3.6/louvain/Optimiser.py build/lib.macosx-10.7-x86_64-3.6/louvain/VertexPartition.py build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py build/lib.macosx-10.7-x86_64-3.6/louvain/init.py Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma UPDATING build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py set build/lib.macosx-10.7-x86_64-3.6/louvain/_version.py to '0.6.1' running build_ext Cannot find the C core of igraph on this system using pkg-config. We will now try to download and compile the C core from scratch. Version number of the C core: 0.7.1
Downloading igraph-0.7.1.tar.gz... 100.00% Extracting igraph-0.7.1.tar.gz... Configuring igraph... checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... ./install-sh -c -d checking for gawk... no checking for mawk... no checking for nawk... no checking for awk... awk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... configure: error: in
/private/tmp/igraph.1hbwqc6m/igraph-0.7.1': configure: error: cannot run C compiled programs. If you meant to cross compile, use
--host'. See `config.log' for more details Could not download and compile the C core of igraph.WARNING: we were not able to detect where igraph is installed on your machine (if it is installed at all). We will use the fallback library and include paths hardcoded in setup.py and hope that the C core of igraph is installed there.
If the compilation fails and you are sure that igraph is installed on your machine, adjust the following two variables in setup.py accordingly and try again:
Build type: dynamic extension
Include path: /usr/include/igraph /usr/local/include/igraph Library path: Linked dynamic libraries: igraph Linked static libraries: Extra compiler options: Extra linker options: building 'louvain._c_louvain' extension creating build/temp.macosx-10.7-x86_64-3.6 creating build/temp.macosx-10.7-x86_64-3.6/src gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -Iinclude -I/usr/include/igraph -I/usr/local/include/igraph -I/anaconda3/include/python3.6m -c src/SignificanceVertexPartition.cpp -o build/temp.macosx-10.7-x86_64-3.6/src/SignificanceVertexPartition.o cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ In file included from /usr/local/include/c++/7.1.0/bits/postypes.h:40:0, from /usr/local/include/c++/7.1.0/bits/char_traits.h:40, from /usr/local/include/c++/7.1.0/string:40, from include/MutableVertexPartition.h:4, from include/SignificanceVertexPartition.h:4, from src/SignificanceVertexPartition.cpp:1: /usr/local/include/c++/7.1.0/cwchar:44:10: fatal error: wchar.h: No such file or directory
include
compilation terminated. error: command 'gcc' failed with exit status 1
ERROR: Command errored out with exit status 1: /anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"'; file='"'"'/private/tmp/pip-install-h9qyyj5m/louvain/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /private/tmp/pip-record-245ts40g/install-record.txt --single-version-externally-managed --compile --install-headers /anaconda3/include/python3.6m/louvain Check the logs for full command output.