topocm / topocm_content

Course on topology in condensed matter
http://topocondmat.org
Other
271 stars 146 forks source link

Failed to install `kwant` while creating the python virtualenv for this project using pip. #238

Closed hongyi-zhao closed 2 years ago

hongyi-zhao commented 2 years ago

On Ubuntu 20.04.3 LTS, I try to create the python virtualenv for this project using pip, but failed to install kwant. The errors are shown as follows:

$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.9.9
$ pyenv shell 3.9.9 
$ pyenv virtualenv --system-site-packages topocm_content
$ pyenv shell topocm_content
$ git clone https://github.com/topocm/topocm_content.git topocm_content.git 
$ cd topocm_content.git 
$ awk '/dependencies:/{a=NR}; {b[NR]=$0} END { for (i=1; i<=NR; i++) if (i>a && b[i] !~ / (python=|pip:)/) {split(b[i],c," ");  print c[length(c)]}}' environment.yml | sed -re 's/(=|>|<).*$//;s/matplotlib-base/matplotlib/' | xargs -n1 pip install

[...]
site-packages (from kwant) (1.2.4)
Building wheels for collected packages: kwant
  Building wheel for kwant (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/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-8uut3w4v
       cwd: /tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/
  Complete output (259 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.9
  creating build/lib.linux-x86_64-3.9/kwant
  copying kwant/__init__.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/version.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/kpm.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/_plotter.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/lattice.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/system.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/_common.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/rmt.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/wraparound.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/_kwant_version.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/plotter.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/_colormaps.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/builder.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/digest.py -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/qsymm.py -> build/lib.linux-x86_64-3.9/kwant
  creating build/lib.linux-x86_64-3.9/kwant/physics
  copying kwant/physics/symmetry.py -> build/lib.linux-x86_64-3.9/kwant/physics
  copying kwant/physics/__init__.py -> build/lib.linux-x86_64-3.9/kwant/physics
  copying kwant/physics/noise.py -> build/lib.linux-x86_64-3.9/kwant/physics
  copying kwant/physics/leads.py -> build/lib.linux-x86_64-3.9/kwant/physics
  copying kwant/physics/gauge.py -> build/lib.linux-x86_64-3.9/kwant/physics
  copying kwant/physics/dispersion.py -> build/lib.linux-x86_64-3.9/kwant/physics
  creating build/lib.linux-x86_64-3.9/kwant/continuum
  copying kwant/continuum/__init__.py -> build/lib.linux-x86_64-3.9/kwant/continuum
  copying kwant/continuum/_common.py -> build/lib.linux-x86_64-3.9/kwant/continuum
  copying kwant/continuum/discretizer.py -> build/lib.linux-x86_64-3.9/kwant/continuum
  creating build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_comprehensive.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_kpm.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_rmt.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_lattice.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_system.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_wraparound.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_operator.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_builder.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_plotter.py -> build/lib.linux-x86_64-3.9/kwant/tests
  copying kwant/tests/test_qsymm.py -> build/lib.linux-x86_64-3.9/kwant/tests
  creating build/lib.linux-x86_64-3.9/kwant/graph
  copying kwant/graph/defs.py -> build/lib.linux-x86_64-3.9/kwant/graph
  copying kwant/graph/__init__.py -> build/lib.linux-x86_64-3.9/kwant/graph
  creating build/lib.linux-x86_64-3.9/kwant/solvers
  copying kwant/solvers/sparse.py -> build/lib.linux-x86_64-3.9/kwant/solvers
  copying kwant/solvers/__init__.py -> build/lib.linux-x86_64-3.9/kwant/solvers
  copying kwant/solvers/common.py -> build/lib.linux-x86_64-3.9/kwant/solvers
  copying kwant/solvers/default.py -> build/lib.linux-x86_64-3.9/kwant/solvers
  copying kwant/solvers/mumps.py -> build/lib.linux-x86_64-3.9/kwant/solvers
  creating build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/__init__.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/decomp_ev.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/fortran_helpers.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/decomp_schur.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/cmumps.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/decomp_lu.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/lll.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  copying kwant/linalg/mumps.py -> build/lib.linux-x86_64-3.9/kwant/linalg
  creating build/lib.linux-x86_64-3.9/kwant/physics/tests
  copying kwant/physics/tests/test_symmetry.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
  copying kwant/physics/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
  copying kwant/physics/tests/test_noise.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
  copying kwant/physics/tests/test_leads.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
  copying kwant/physics/tests/test_dispersion.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
  copying kwant/physics/tests/test_gauge.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
  creating build/lib.linux-x86_64-3.9/kwant/continuum/tests
  copying kwant/continuum/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/continuum/tests
  copying kwant/continuum/tests/test_discretizer.py -> build/lib.linux-x86_64-3.9/kwant/continuum/tests
  copying kwant/continuum/tests/test_common.py -> build/lib.linux-x86_64-3.9/kwant/continuum/tests
  creating build/lib.linux-x86_64-3.9/kwant/graph/tests
  copying kwant/graph/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/graph/tests
  copying kwant/graph/tests/test_core.py -> build/lib.linux-x86_64-3.9/kwant/graph/tests
  copying kwant/graph/tests/test_scotch.py -> build/lib.linux-x86_64-3.9/kwant/graph/tests
  creating build/lib.linux-x86_64-3.9/kwant/solvers/tests
  copying kwant/solvers/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
  copying kwant/solvers/tests/test_sparse.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
  copying kwant/solvers/tests/test_mumps.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
  copying kwant/solvers/tests/_test_sparse.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
  creating build/lib.linux-x86_64-3.9/kwant/linalg/tests
  copying kwant/linalg/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
  copying kwant/linalg/tests/_test_utils.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
  copying kwant/linalg/tests/test_linalg.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
  copying kwant/linalg/tests/test_lll.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
  copying kwant/linalg/tests/test_mumps.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
  copying kwant/operator.pxd -> build/lib.linux-x86_64-3.9/kwant
  copying kwant/graph/core.pxd -> build/lib.linux-x86_64-3.9/kwant/graph
  copying kwant/graph/defs.pxd -> build/lib.linux-x86_64-3.9/kwant/graph
  copying kwant/graph/c_scotch.pxd -> build/lib.linux-x86_64-3.9/kwant/graph
  copying kwant/graph/defs.h -> build/lib.linux-x86_64-3.9/kwant/graph
  copying kwant/linalg/cmumps.pxd -> build/lib.linux-x86_64-3.9/kwant/linalg
  running build_ext
  building 'kwant._system' extension
  creating build/temp.linux-x86_64-3.9
  creating build/temp.linux-x86_64-3.9/kwant
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ikwant/graph -I/home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include -I/home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/include -I/home/apollo/.pyenv/versions/3.9.9/include/python3.9 -c kwant/_system.c -o build/temp.linux-x86_64-3.9/kwant/_system.o
  In file included from /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969,
                   from /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from kwant/_system.c:639:
  /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
     17 | #warning "Using deprecated NumPy API, disable it with " \
        |  ^~~~~~~
  kwant/_system.c: In function ‘__Pyx_modinit_type_init_code’:
  kwant/_system.c:29696:71: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29696 |   __pyx_type_5kwant_7_system___pyx_scope_struct__hamiltonian_submatrix.tp_print = 0;
        |                                                                       ^
  kwant/_system.c:29702:58: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29702 |   __pyx_type_5kwant_7_system___pyx_scope_struct_1_genexpr.tp_print = 0;
        |                                                          ^
  kwant/_system.c:29708:58: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29708 |   __pyx_type_5kwant_7_system___pyx_scope_struct_2_genexpr.tp_print = 0;
        |                                                          ^
  kwant/_system.c:29716:25: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29716 |   __pyx_type___pyx_array.tp_print = 0;
        |                         ^
  kwant/_system.c:29721:31: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29721 |   __pyx_type___pyx_MemviewEnum.tp_print = 0;
        |                               ^
  kwant/_system.c:29736:30: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29736 |   __pyx_type___pyx_memoryview.tp_print = 0;
        |                              ^
  kwant/_system.c:29749:35: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
  29749 |   __pyx_type___pyx_memoryviewslice.tp_print = 0;
        |                                   ^
  kwant/_system.c: In function ‘__Pyx_ParseOptionalKeywords’:
  kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30619:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30619:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                     ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30635:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30635:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
  30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
    580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
        |                                             ^~~~~~~~~~~~~~~~~~~
  kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
  30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
        |                         ^
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
    446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
  kwant/_system.c: In function ‘__Pyx_decode_c_string’:
  kwant/_system.c:32354:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
  32354 |         return PyUnicode_FromUnicode(NULL, 0);
        |         ^~~~~~
  In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                   from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                   from kwant/_system.c:30:
  /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:551:42: note: declared here
    551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
        |                                          ^~~~~~~~~~~~~~~~~~~~~

  ************************************ Error ************************************
  The compilation of Kwant has failed.  Please examine the error message
  above and consult the installation instructions in README.rst.
  You might have to customize build.conf.

  Build configuration was:

  ['No MUMPS support']
  *******************************************************************************

  error: command '/usr/bin/gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for kwant
  Running setup.py clean for kwant
Failed to build kwant
Installing collected packages: kwant
    Running setup.py install for kwant ... error
    ERROR: Command errored out with exit status 1:
     command: /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/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-d0oj02ws/install-record.txt --single-version-externally-managed --compile --install-headers /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/include/site/python3.9/kwant
         cwd: /tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/
    Complete output (259 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.9
    creating build/lib.linux-x86_64-3.9/kwant
    copying kwant/__init__.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/version.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/kpm.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/_plotter.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/lattice.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/system.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/_common.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/rmt.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/wraparound.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/_kwant_version.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/plotter.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/_colormaps.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/builder.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/digest.py -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/qsymm.py -> build/lib.linux-x86_64-3.9/kwant
    creating build/lib.linux-x86_64-3.9/kwant/physics
    copying kwant/physics/symmetry.py -> build/lib.linux-x86_64-3.9/kwant/physics
    copying kwant/physics/__init__.py -> build/lib.linux-x86_64-3.9/kwant/physics
    copying kwant/physics/noise.py -> build/lib.linux-x86_64-3.9/kwant/physics
    copying kwant/physics/leads.py -> build/lib.linux-x86_64-3.9/kwant/physics
    copying kwant/physics/gauge.py -> build/lib.linux-x86_64-3.9/kwant/physics
    copying kwant/physics/dispersion.py -> build/lib.linux-x86_64-3.9/kwant/physics
    creating build/lib.linux-x86_64-3.9/kwant/continuum
    copying kwant/continuum/__init__.py -> build/lib.linux-x86_64-3.9/kwant/continuum
    copying kwant/continuum/_common.py -> build/lib.linux-x86_64-3.9/kwant/continuum
    copying kwant/continuum/discretizer.py -> build/lib.linux-x86_64-3.9/kwant/continuum
    creating build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_comprehensive.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_kpm.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_rmt.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_lattice.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_system.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_wraparound.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_operator.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_builder.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_plotter.py -> build/lib.linux-x86_64-3.9/kwant/tests
    copying kwant/tests/test_qsymm.py -> build/lib.linux-x86_64-3.9/kwant/tests
    creating build/lib.linux-x86_64-3.9/kwant/graph
    copying kwant/graph/defs.py -> build/lib.linux-x86_64-3.9/kwant/graph
    copying kwant/graph/__init__.py -> build/lib.linux-x86_64-3.9/kwant/graph
    creating build/lib.linux-x86_64-3.9/kwant/solvers
    copying kwant/solvers/sparse.py -> build/lib.linux-x86_64-3.9/kwant/solvers
    copying kwant/solvers/__init__.py -> build/lib.linux-x86_64-3.9/kwant/solvers
    copying kwant/solvers/common.py -> build/lib.linux-x86_64-3.9/kwant/solvers
    copying kwant/solvers/default.py -> build/lib.linux-x86_64-3.9/kwant/solvers
    copying kwant/solvers/mumps.py -> build/lib.linux-x86_64-3.9/kwant/solvers
    creating build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/__init__.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/decomp_ev.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/fortran_helpers.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/decomp_schur.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/cmumps.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/decomp_lu.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/lll.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    copying kwant/linalg/mumps.py -> build/lib.linux-x86_64-3.9/kwant/linalg
    creating build/lib.linux-x86_64-3.9/kwant/physics/tests
    copying kwant/physics/tests/test_symmetry.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
    copying kwant/physics/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
    copying kwant/physics/tests/test_noise.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
    copying kwant/physics/tests/test_leads.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
    copying kwant/physics/tests/test_dispersion.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
    copying kwant/physics/tests/test_gauge.py -> build/lib.linux-x86_64-3.9/kwant/physics/tests
    creating build/lib.linux-x86_64-3.9/kwant/continuum/tests
    copying kwant/continuum/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/continuum/tests
    copying kwant/continuum/tests/test_discretizer.py -> build/lib.linux-x86_64-3.9/kwant/continuum/tests
    copying kwant/continuum/tests/test_common.py -> build/lib.linux-x86_64-3.9/kwant/continuum/tests
    creating build/lib.linux-x86_64-3.9/kwant/graph/tests
    copying kwant/graph/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/graph/tests
    copying kwant/graph/tests/test_core.py -> build/lib.linux-x86_64-3.9/kwant/graph/tests
    copying kwant/graph/tests/test_scotch.py -> build/lib.linux-x86_64-3.9/kwant/graph/tests
    creating build/lib.linux-x86_64-3.9/kwant/solvers/tests
    copying kwant/solvers/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
    copying kwant/solvers/tests/test_sparse.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
    copying kwant/solvers/tests/test_mumps.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
    copying kwant/solvers/tests/_test_sparse.py -> build/lib.linux-x86_64-3.9/kwant/solvers/tests
    creating build/lib.linux-x86_64-3.9/kwant/linalg/tests
    copying kwant/linalg/tests/__init__.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
    copying kwant/linalg/tests/_test_utils.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
    copying kwant/linalg/tests/test_linalg.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
    copying kwant/linalg/tests/test_lll.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
    copying kwant/linalg/tests/test_mumps.py -> build/lib.linux-x86_64-3.9/kwant/linalg/tests
    copying kwant/operator.pxd -> build/lib.linux-x86_64-3.9/kwant
    copying kwant/graph/core.pxd -> build/lib.linux-x86_64-3.9/kwant/graph
    copying kwant/graph/defs.pxd -> build/lib.linux-x86_64-3.9/kwant/graph
    copying kwant/graph/c_scotch.pxd -> build/lib.linux-x86_64-3.9/kwant/graph
    copying kwant/graph/defs.h -> build/lib.linux-x86_64-3.9/kwant/graph
    copying kwant/linalg/cmumps.pxd -> build/lib.linux-x86_64-3.9/kwant/linalg
    running build_ext
    building 'kwant._system' extension
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/kwant
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -Ikwant/graph -I/home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include -I/home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/include -I/home/apollo/.pyenv/versions/3.9.9/include/python3.9 -c kwant/_system.c -o build/temp.linux-x86_64-3.9/kwant/_system.o
    In file included from /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1969,
                     from /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from kwant/_system.c:639:
    /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
       17 | #warning "Using deprecated NumPy API, disable it with " \
          |  ^~~~~~~
    kwant/_system.c: In function ‘__Pyx_modinit_type_init_code’:
    kwant/_system.c:29696:71: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29696 |   __pyx_type_5kwant_7_system___pyx_scope_struct__hamiltonian_submatrix.tp_print = 0;
          |                                                                       ^
    kwant/_system.c:29702:58: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29702 |   __pyx_type_5kwant_7_system___pyx_scope_struct_1_genexpr.tp_print = 0;
          |                                                          ^
    kwant/_system.c:29708:58: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29708 |   __pyx_type_5kwant_7_system___pyx_scope_struct_2_genexpr.tp_print = 0;
          |                                                          ^
    kwant/_system.c:29716:25: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29716 |   __pyx_type___pyx_array.tp_print = 0;
          |                         ^
    kwant/_system.c:29721:31: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29721 |   __pyx_type___pyx_MemviewEnum.tp_print = 0;
          |                               ^
    kwant/_system.c:29736:30: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29736 |   __pyx_type___pyx_memoryview.tp_print = 0;
          |                              ^
    kwant/_system.c:29749:35: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
    29749 |   __pyx_type___pyx_memoryviewslice.tp_print = 0;
          |                                   ^
    kwant/_system.c: In function ‘__Pyx_ParseOptionalKeywords’:
    kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30619:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30619:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30619:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30619 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30635:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30635:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
    30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    kwant/_system.c:30635:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
    30635 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    kwant/_system.c: In function ‘__Pyx_decode_c_string’:
    kwant/_system.c:32354:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
    32354 |         return PyUnicode_FromUnicode(NULL, 0);
          |         ^~~~~~
    In file included from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/unicodeobject.h:1026,
                     from /home/apollo/.pyenv/versions/3.9.9/include/python3.9/Python.h:93,
                     from kwant/_system.c:30:
    /home/apollo/.pyenv/versions/3.9.9/include/python3.9/cpython/unicodeobject.h:551:42: note: declared here
      551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
          |                                          ^~~~~~~~~~~~~~~~~~~~~

    ************************************ Error ************************************
    The compilation of Kwant has failed.  Please examine the error message
    above and consult the installation instructions in README.rst.
    You might have to customize build.conf.

    Build configuration was:

    ['No MUMPS support']
    *******************************************************************************

    error: command '/usr/bin/gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/bin/python3.9 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g88pezou/kwant_a38bc6e2ba564bdcbba8cecb5189e3b9/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-d0oj02ws/install-record.txt --single-version-externally-managed --compile --install-headers /home/apollo/.pyenv/versions/3.9.9/envs/topocm_content/include/site/python3.9/kwant Check the logs for full command output.

See here for the relevant discussion. Any hints for fixing this problem will be highly appreciated.

Regards, HZ

akhmerov commented 2 years ago

Compiling topocm's requirements from source is hard; did you consider conda? That's the recommended way to run the course materials.

hongyi-zhao commented 2 years ago

Now, after installation of the kwant dependencies, I've successfully created the python virtualenv used by topocm, see here for more detailed info. I describe the steps as following:

#https://kwant-project.org/doc/1/pre/install#unix-like-systems-gnu-linux
$ sudo apt-get install python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libmumps-scotch-dev
#https://kwant-project.org/install#installing-non-python-dependencies
$ sudo apt-get install build-essential gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
$ pyenv shell 3.9.7
$ pyenv virtualenv --system-site-packages topocm_content
$ pyenv shell topocm_content
$ pip install cython pytest
$ git clone https://github.com/topocm/topocm_content.git topocm_content.git 
$ cd topocm_content.git 
$ awk '/dependencies:/{a=NR}; {b[NR]=$0} END { for (i=1; i<=NR; i++) if (i>a && b[i] !~ / (python=|pip:)/) {split(b[i],c," ");  print c[length(c)]}}' environment.yml | sed -re 's/(=|>|<).*$//;s/matplotlib-base/matplotlib/' | xargs -n1 pip install

If you want to build kwant from source and build documentation at the same time, please use the following steps described here:

#https://gitlab.kwant-project.org/kwant/kwant/-/issues/413#note_56463
#https://kwant-project.org/doc/1/pre/install#unix-like-systems-gnu-linux
$ sudo apt-get install python3-dev python3-setuptools python3-scipy python3-matplotlib python3-pytest python3-sympy g++ gfortran libmumps-scotch-dev
#https://kwant-project.org/install#installing-non-python-dependencies
$ sudo apt-get install build-essential gfortran libopenblas-dev liblapack-dev libmumps-scotch-dev
$ pyenv shell 3.9.7
$ pyenv virtualenv --system-site-packages kwant
$ pyenv shell kwant
$ pip install cython pytest
$ git clone https://gitlab.kwant-project.org/kwant/kwant.git kwant.git
$ cd kwant.git
#https://kwant-project.org/doc/1/pre/install#building-and-installing-kwant
$ python3 setup.py build 
$ python3 setup.py install
#Or replace the above two commands with the following one:
$ pip install -e .
#After installation, tests can be run with:
$ python3 -c 'import kwant; kwant.test()'
#https://kwant-project.org/doc/1/pre/install#building-the-documentation
#As a prerequisite for building the documentation, Kwant must have been built successfully using python3 setup.py build as described above (or Kwant must be already installed in Python’s search path). 
$ sudo apt install librsvg2-bin
#https://github.com/missinglinkelectronics/sphinxcontrib-svg2pdfconverter#sphinx-svg-to-pdf-converter-extension
$ pip install sphinxcontrib-svg2pdfconverter[CairoSVG] plotly qsymm
$ make html
$ make latex 
#The LaTeX files are in build/latex.
#Run 'make' in that directory to run these through (pdf)latex
#(use `make latexpdf' here to do that automatically).
$ cd build/latex
$ make all-pdf 
akhmerov commented 2 years ago

@hongyi-zhao I'm going to close this issue: installing Kwant via pip is outside the scope of what we aim to support with the course; conda is the recommended option.