Python cannot add package leidenalg

51 views Asked by At

I want to install leidenalg package, but it failed both through pip and through Pycharm's package manager.

This is the error I get when installing with Pycharm package manager:

  Using cached leidenalg-0.8.10.tar.gz (3.8 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Requirement already satisfied: igraph<0.10,>=0.9.0 in /home/hm31/step_1/venv/lib64/python3.6/site-packages (from leidenalg) (0.9.11)
Requirement already satisfied: texttable>=1.6.2 in /home/hm31/step_1/venv/lib/python3.6/site-packages (from igraph<0.10,>=0.9.0->leidenalg) (1.7.0)
Building wheels for collected packages: leidenalg
  Building wheel for leidenalg (setup.py): started
  Building wheel for leidenalg (setup.py): finished with status 'error'
  Running setup.py clean for leidenalg
Failed to build leidenalg
Installing collected packages: leidenalg
    Running setup.py install for leidenalg: started
    Running setup.py install for leidenalg: finished with status 'error'

  ERROR: Command errored out with exit status 1:
   command: /home/hm31/step_1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-jowsz042
       cwd: /tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/
  Complete output (28 lines):
  /home/hm31/step_1/venv/lib/python3.6/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
    SetuptoolsDeprecationWarning,
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/Optimiser.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/VertexPartition.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/__init__.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/functions.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/version.py -> build/lib.linux-x86_64-3.6/leidenalg
  running build_ext
  running build_c_core
  We are going to build the C core of igraph.
    Source folder: vendor/source/igraph
    Build folder: vendor/build/igraph
    Install folder: vendor/install/igraph
  
  Configuring build...
  CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
    CMake 3.16 or higher is required.  You are running version 2.8.12.2
  
  
  -- Configuring incomplete, errors occurred!
  Build failed for the C core of igraph.
  
  ----------------------------------------
  ERROR: Failed building wheel for leidenalg
WARNING: Error parsing requirements for decorator: [Errno 2] No such file or directory: '/home/hm31/step_1/venv/lib/python3.6/site-packages/decorator-5.1.1.dist-info/METADATA'
    ERROR: Command errored out with exit status 1:
     command: /home/hm31/step_1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8ze98gsh/install-record.txt --single-version-externally-managed --compile --install-headers /home/hm31/step_1/venv/include/site/python3.6/leidenalg
         cwd: /tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/
    Complete output (30 lines):
    /home/hm31/step_1/venv/lib/python3.6/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      SetuptoolsDeprecationWarning,
    running install
    /home/hm31/step_1/venv/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      setuptools.SetuptoolsDeprecationWarning,
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/Optimiser.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/VertexPartition.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/__init__.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/functions.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/version.py -> build/lib.linux-x86_64-3.6/leidenalg
    running build_ext
    running build_c_core
    We are going to build the C core of igraph.
      Source folder: vendor/source/igraph
      Build folder: vendor/build/igraph
      Install folder: vendor/install/igraph
    
    Configuring build...
    CMake Error at CMakeLists.txt:4 (cmake_minimum_required):
      CMake 3.16 or higher is required.  You are running version 2.8.12.2
    
    
    -- Configuring incomplete, errors occurred!
    Build failed for the C core of igraph.
    
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/hm31/step_1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bj6ahghf/leidenalg_0b2f9bf76b0743108c873593854884a4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-8ze98gsh/install-record.txt --single-version-externally-managed --compile --install-headers /home/hm31/step_1/venv/include/site/python3.6/leidenalg Check the logs for full command output.

I omitted the pip error due to space constraints. I am using Python 3.6.8. Additionally, I recall adding Leidenalg to a conda environment with some difficulties that I don't remember now. I'm currently using Venv.

Thanks.

P.S: Even after upgrading cmake, this is the error I get:

(venv) [hm31@chackoge-serv01 step_10_cluster]$ pip install leidenalg
Collecting leidenalg
  Using cached leidenalg-0.8.10.tar.gz (3.8 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: igraph<0.10,>=0.9.0 in /home/hm31/step_1/venv/lib64/python3.6/site-packages (from leidenalg) (0.9.11)
Requirement already satisfied: texttable>=1.6.2 in /home/hm31/step_1/venv/lib/python3.6/site-packages (from igraph<0.10,>=0.9.0->leidenalg) (1.7.0)
Building wheels for collected packages: leidenalg
  Building wheel for leidenalg (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/hm31/step_1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-z3o7dnh2
       cwd: /tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/
  Complete output (1059 lines):
  /home/hm31/step_1/venv/lib/python3.6/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
    SetuptoolsDeprecationWarning,
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.6
  creating build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/Optimiser.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/VertexPartition.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/__init__.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/functions.py -> build/lib.linux-x86_64-3.6/leidenalg
  copying src/leidenalg/version.py -> build/lib.linux-x86_64-3.6/leidenalg
  running build_ext
  running build_c_core
  We are going to build the C core of igraph.
    Source folder: vendor/source/igraph
    Build folder: vendor/build/igraph
    Install folder: vendor/install/igraph
  
  Configuring build...
  -- Setting build type to 'Release' as none was specified.
  -- Version number: 0.9.8
  -- The C compiler identification is GNU 4.8.5
  -- The CXX compiler identification is GNU 4.8.5
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Performing Test COMPILER_SUPPORTS_NO_VARARGS_FLAG
  -- Performing Test COMPILER_SUPPORTS_NO_VARARGS_FLAG - Success
  -- Performing Test COMPILER_SUPPORTS_NO_UNKNOWN_WARNING_OPTION_FLAG
  -- Performing Test COMPILER_SUPPORTS_NO_UNKNOWN_WARNING_OPTION_FLAG - Success
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD
  -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
  -- Looking for pthread_create in pthreads
  -- Looking for pthread_create in pthreads - not found
  -- Looking for pthread_create in pthread
  -- Looking for pthread_create in pthread - found
  -- Found Threads: TRUE
  -- Found FLEX: /usr/bin/flex (found version "2.5.37")
  -- Found BISON: /usr/bin/bison (found version "3.0.4")
  -- Looking for expm1
  -- Looking for expm1 - found
  -- Looking for fmin
  -- Looking for fmin - found
  -- Looking for finite
  -- Looking for finite - found
  -- Looking for isfinite
  -- Looking for isfinite - found
  -- Looking for log2
  -- Looking for log2 - found
  -- Looking for log1p
  -- Looking for log1p - found
  -- Looking for rint
  -- Looking for rint - found
  -- Looking for rintf
  -- Looking for rintf - found
  -- Looking for round
  -- Looking for round - found
  -- Looking for stpcpy
  -- Looking for stpcpy - found
  -- Looking for strcasecmp
  -- Looking for strcasecmp - found
  -- Looking for strdup
  -- Looking for strdup - found
  -- Looking for _stricmp
  -- Looking for _stricmp - not found
  -- Looking for _LIBCPP_VERSION
  -- Looking for _LIBCPP_VERSION - not found
  -- Looking for __GLIBCXX__
  -- Looking for __GLIBCXX__ - found
  -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
  -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
  -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
  -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
  -- Performing Test COMPILER_HAS_DEPRECATED_ATTR
  -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
  -- Found Python3: /home/hm31/step_1/venv/bin/python3.6 (found version "3.6.8") found components: Interpreter
  --
  -- -----[ Build configuration ]----
  -- Version:                   0.9.8
  -- CMake build type:        Release
  -- Library type:             static
  --
  -- ----------[ Features ]----------
  -- GLPK for optimization:       yes
  -- Reading GraphML files:       yes
  -- Thread-local storage:         no
  -- Link-time optimization:       no
  --
  -- --------[ Dependencies ]--------
  -- ARPACK:                 vendored
  -- BISON:                       yes
  -- BLAS:                   vendored
  -- CXSparse:               vendored
  -- FLEX:                        yes
  -- GLPK:                   vendored
  -- GMP:                    vendored
  -- LAPACK:                 vendored
  -- LibXml2:                     yes
  -- OpenMP:                      yes
  -- PLFIT:                  vendored
  --
  -- -----------[ Testing ]----------
  -- Diff tool:             not found
  -- Sanitizers:                 none
  -- Code coverage:                no
  -- Verify 'finally' stack:       no
  --
  -- --------[ Documentation ]-------
  -- HTML:                         no
  -- PDF:                          no
  --
  -- igraph configured successfully.
  --
  -- Configuring done (3.0s)
  -- Generating done (0.2s)
  -- Build files have been written to: /tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/vendor/build/igraph
  Running build...
  (Omitted due to space limits)
  Installing build...
  -- Installing: /tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/vendor/install/igraph/lib64/libigraph.a
  -- Installing: /tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/vendor/install/igraph/include/igraph
  -- Installing: /tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/vendor/install/igraph/include/igraph/igraph.h
h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/vendor/install/igraph/lib64/cmake/igraph/igraph-targets-release.cmake
  Libraries: ['igraph', 'm', 'stdc++', 'xml2', 'z', 'gomp', 'pthread']
  Exclusions: []
  Found igraph as static library in vendor/install/igraph/lib64/libigraph.a.
  Build type: dynamic extension with vendored igraph source
  Include path: vendor/install/igraph/include/igraph
  Library path: vendor/install/igraph/lib64 /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib /lib64 /lib
  Runtime library path:
  Linked dynamic libraries: m xml2 z gomp pthread
  Linked static libraries: vendor/install/igraph/lib64/libigraph.a
  Extra compiler options:
  Extra linker options:
  building 'leidenalg._c_leiden' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/src
  creating build/temp.linux-x86_64-3.6/src/leidenalg
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Iinclude -Ivendor/install/igraph/include/igraph -I/home/hm31/step_1/venv/include -I/usr/include/python3.6m -c src/leidenalg/CPMVertexPartition.cpp -o build/temp.linux-x86_64-3.6/src/leidenalg/CPMVertexPartition.o
  In file included from include/MutableVertexPartition.h:5:0,
                   from include/ResolutionParameterVertexPartition.h:4,
                   from include/LinearResolutionParameterVertexPartition.h:4,
                   from include/CPMVertexPartition.h:4,
                   from src/leidenalg/CPMVertexPartition.cpp:1:
  include/GraphHelper.h: In function ‘T sum(std::vector<T>)’:
  include/GraphHelper.h:35:14: error: range-based ‘for’ loops are not allowed in C++98 mode
     for (T x : vec)
                ^
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for leidenalg
  Running setup.py clean for leidenalg
Failed to build leidenalg
WARNING: Error parsing requirements for decorator: [Errno 2] No such file or directory: '/home/hm31/step_1/venv/lib/python3.6/site-packages/decorator-5.1.1.dist-info/METADATA'
Installing collected packages: leidenalg
    Running setup.py install for leidenalg ... error
    ERROR: Command errored out with exit status 1:
     command: /home/hm31/step_1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9i4vehuu/install-record.txt --single-version-externally-managed --compile --install-headers /home/hm31/step_1/venv/include/site/python3.6/leidenalg
         cwd: /tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/
    Complete output (43 lines):
    /home/hm31/step_1/venv/lib/python3.6/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
      SetuptoolsDeprecationWarning,
    running install
    /home/hm31/step_1/venv/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
      setuptools.SetuptoolsDeprecationWarning,
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.6
    creating build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/Optimiser.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/VertexPartition.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/__init__.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/functions.py -> build/lib.linux-x86_64-3.6/leidenalg
    copying src/leidenalg/version.py -> build/lib.linux-x86_64-3.6/leidenalg
    running build_ext
    running build_c_core
    Libraries: ['igraph', 'm', 'stdc++', 'xml2', 'z', 'gomp', 'pthread']
    Exclusions: []
    Found igraph as static library in vendor/install/igraph/lib64/libigraph.a.
    Build type: dynamic extension with vendored igraph source
    Include path: vendor/install/igraph/include/igraph
    Library path: vendor/install/igraph/lib64 /usr/local/lib64 /usr/local/lib /usr/lib64 /usr/lib /lib64 /lib
    Runtime library path:
    Linked dynamic libraries: m xml2 z gomp pthread
    Linked static libraries: vendor/install/igraph/lib64/libigraph.a
    Extra compiler options:
    Extra linker options:
    building 'leidenalg._c_leiden' extension
    creating build/temp.linux-x86_64-3.6
    creating build/temp.linux-x86_64-3.6/src
    creating build/temp.linux-x86_64-3.6/src/leidenalg
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -Iinclude -Ivendor/install/igraph/include/igraph -I/home/hm31/step_1/venv/include -I/usr/include/python3.6m -c src/leidenalg/CPMVertexPartition.cpp -o build/temp.linux-x86_64-3.6/src/leidenalg/CPMVertexPartition.o
    In file included from include/MutableVertexPartition.h:5:0,
                     from include/ResolutionParameterVertexPartition.h:4,
                     from include/LinearResolutionParameterVertexPartition.h:4,
                     from include/CPMVertexPartition.h:4,
                     from src/leidenalg/CPMVertexPartition.cpp:1:
    include/GraphHelper.h: In function ‘T sum(std::vector<T>)’:
    include/GraphHelper.h:35:14: error: range-based ‘for’ loops are not allowed in C++98 mode
       for (T x : vec)
                  ^
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/hm31/step_1/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/setup.py'"'"'; __file__='"'"'/tmp/pip-install-h9r0okpt/leidenalg_f86369d826b04bc6bd372ccd68782138/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-9i4vehuu/install-record.txt --single-version-externally-managed --compile --install-headers /home/hm31/step_1/venv/include/site/python3.6/leidenalg Check the logs for full command output.```

0

There are 0 answers