LINUX.ORG.RU

Ошибка при установке пакета csv в питоне

 


0

1

Приветствую.

Может кто нибудь помочь установить пакет python-csv, это нужно для чтения csv файла.

Устновка прерывается при удовлетварении зависимости от пакета leven.

pip3 install leven
Defaulting to user installation because normal site-packages is not writeable
Collecting leven
  Using cached leven-1.0.4.tar.gz (20 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: six in /usr/lib/python3/dist-packages (from leven) (1.16.0)
Requirement already satisfied: nose in ./.local/lib/python3.11/site-packages (from leven) (1.3.7)
Building wheels for collected packages: leven
  Building wheel for leven (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [144 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/leven
      copying leven/__init__.py -> build/lib.linux-x86_64-cpython-311/leven
      running build_ext
      building 'leven._levenshtein' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/leven
      x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -Ileven -I/usr/include/python3.11 -c leven/_levenshtein.cpp -o build/temp.linux-x86_64-cpython-311/leven/_levenshtein.o
      In file included from /usr/include/python3.11/unicodeobject.h:1042,
                       from /usr/include/python3.11/Python.h:51,
                       from leven/_levenshtein.cpp:16:
      leven/_levenshtein.cpp: In function ‘PyObject* __pyx_pf_5leven_12_levenshtein_levenshtein(PyObject*, PyObject*, PyObject*, PyObject*)’:
      /usr/include/python3.11/cpython/unicodeobject.h:698:56: warning: ‘Py_UNICODE* PyUnicode_AS_UNICODE(PyObject*)’ is deprecated [-Wdeprecated-declarations]
        698 | #  define PyUnicode_AS_UNICODE(op) PyUnicode_AS_UNICODE(_PyObject_CAST(op))
            |                                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1004:42: note: in expansion of macro ‘PyUnicode_AS_UNICODE’
       1004 |       __pyx_t_7 = levenshtein_Py_UNICODE(PyUnicode_AS_UNICODE(__pyx_v_a), __pyx_v_m, PyUnicode_AS_UNICODE(__pyx_v_b), __pyx_v_n);
            |                                          ^~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:685:27: note: declared here
        685 | static inline Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *op)
            |                           ^~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:698:56: warning: ‘Py_UNICODE* PyUnicode_AS_UNICODE(PyObject*)’ is deprecated [-Wdeprecated-declarations]
        698 | #  define PyUnicode_AS_UNICODE(op) PyUnicode_AS_UNICODE(_PyObject_CAST(op))
            |                                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1004:86: note: in expansion of macro ‘PyUnicode_AS_UNICODE’
       1004 |       __pyx_t_7 = levenshtein_Py_UNICODE(PyUnicode_AS_UNICODE(__pyx_v_a), __pyx_v_m, PyUnicode_AS_UNICODE(__pyx_v_b), __pyx_v_n);
            |                                                                                      ^~~~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:685:27: note: declared here
        685 | static inline Py_UNICODE* PyUnicode_AS_UNICODE(PyObject *op)
            |                           ^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp: In function ‘int __Pyx_InitCachedConstants()’:
      leven/_levenshtein.cpp:1194:216: error: invalid conversion from ‘int’ to ‘PyObject*’ {aka ‘_object*’} [-fpermissive]
       1194 |   __pyx_k_codeobj_4 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_5, __pyx_n_s__levenshtein, 28, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            |                                                                                                                                                                                                                        ^~
            |                                                                                                                                                                                                                        |
            |                                                                                                                                                                                                                        int
      leven/_levenshtein.cpp:119:72: note: in definition of macro ‘__Pyx_PyCode_New’
        119 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
            |                                                                        ^~~~~
      leven/_levenshtein.cpp:1194:220: error: invalid conversion from ‘PyObject*’ {aka ‘_object*’} to ‘int’ [-fpermissive]
       1194 |   __pyx_k_codeobj_4 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_5, __pyx_n_s__levenshtein, 28, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            |                                                                                                                                                                                                                            ^~~~~~~~~~~~~~~~~
            |                                                                                                                                                                                                                            |
            |                                                                                                                                                                                                                            PyObject* {aka _object*}
      leven/_levenshtein.cpp:119:79: note: in definition of macro ‘__Pyx_PyCode_New’
        119 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
            |                                                                               ^~~~
      leven/_levenshtein.cpp:119:21: error: too few arguments to function ‘PyCodeObject* PyCode_New(int, int, int, int, int, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, int, PyObject*, PyObject*)’
        119 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
            |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1194:34: note: in expansion of macro ‘__Pyx_PyCode_New’
       1194 |   __pyx_k_codeobj_4 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_5, __pyx_n_s__levenshtein, 28, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            |                                  ^~~~~~~~~~~~~~~~
      In file included from /usr/include/python3.11/Python.h:71:
      /usr/include/python3.11/cpython/code.h:148:28: note: declared here
        148 | PyAPI_FUNC(PyCodeObject *) PyCode_New(
            |                            ^~~~~~~~~~
      leven/_levenshtein.cpp: In function ‘int __Pyx_ParseOptionalKeywords(PyObject*, PyObject***, PyObject*, PyObject**, Py_ssize_t, const char*)’:
      /usr/include/python3.11/cpython/unicodeobject.h:664:52: warning: ‘Py_ssize_t PyUnicode_GET_SIZE(PyObject*)’ is deprecated [-Wdeprecated-declarations]
        664 | #  define PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(_PyObject_CAST(op))
            |                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1464:22: note: in expansion of macro ‘PyUnicode_GET_SIZE’
       1464 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                      ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:652:26: note: declared here
        652 | static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op)
            |                          ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:664:52: warning: ‘Py_ssize_t PyUnicode_GET_SIZE(PyObject*)’ is deprecated [-Wdeprecated-declarations]
        664 | #  define PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(_PyObject_CAST(op))
            |                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1464:52: note: in expansion of macro ‘PyUnicode_GET_SIZE’
       1464 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                                                    ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:652:26: note: declared here
        652 | static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op)
            |                          ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:664:52: warning: ‘Py_ssize_t PyUnicode_GET_SIZE(PyObject*)’ is deprecated [-Wdeprecated-declarations]
        664 | #  define PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(_PyObject_CAST(op))
            |                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1480:26: note: in expansion of macro ‘PyUnicode_GET_SIZE’
       1480 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                          ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:652:26: note: declared here
        652 | static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op)
            |                          ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:664:52: warning: ‘Py_ssize_t PyUnicode_GET_SIZE(PyObject*)’ is deprecated [-Wdeprecated-declarations]
        664 | #  define PyUnicode_GET_SIZE(op) PyUnicode_GET_SIZE(_PyObject_CAST(op))
            |                                  ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1480:59: note: in expansion of macro ‘PyUnicode_GET_SIZE’
       1480 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
            |                                                           ^~~~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/unicodeobject.h:652:26: note: declared here
        652 | static inline Py_ssize_t PyUnicode_GET_SIZE(PyObject *op)
            |                          ^~~~~~~~~~~~~~~~~~
      In file included from /usr/include/python3.11/Python.h:95:
      leven/_levenshtein.cpp: In function ‘void __Pyx_Raise(PyObject*, PyObject*, PyObject*, PyObject*)’:
      /usr/include/python3.11/ceval.h:34:34: warning: ‘PyObject* PyEval_CallObjectWithKeywords(PyObject*, PyObject*, PyObject*)’ is deprecated [-Wdeprecated-declarations]
         34 |     PyEval_CallObjectWithKeywords(callable, arg, (PyObject *)NULL)
            |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:1644:26: note: in expansion of macro ‘PyEval_CallObject’
       1644 |         owned_instance = PyEval_CallObject(type, args);
            |                          ^~~~~~~~~~~~~~~~~
      /usr/include/python3.11/ceval.h:27:43: note: declared here
         27 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
            |                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp: In function ‘PyCodeObject* __Pyx_CreateCodeObjectForTraceback(const char*, int, int, const char*)’:
      leven/_levenshtein.cpp:2483:9: error: invalid conversion from ‘int’ to ‘PyObject*’ {aka ‘_object*’} [-fpermissive]
       2483 |         py_line,      /*int firstlineno,*/
            |         ^~~~~~~
            |         |
            |         int
      leven/_levenshtein.cpp:119:72: note: in definition of macro ‘__Pyx_PyCode_New’
        119 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
            |                                                                        ^~~~~
      leven/_levenshtein.cpp:2484:9: error: invalid conversion from ‘PyObject*’ {aka ‘_object*’} to ‘int’ [-fpermissive]
       2484 |         __pyx_empty_bytes  /*PyObject *lnotab*/
            |         ^~~~~~~~~~~~~~~~~
            |         |
            |         PyObject* {aka _object*}
      leven/_levenshtein.cpp:119:79: note: in definition of macro ‘__Pyx_PyCode_New’
        119 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
            |                                                                               ^~~~
      leven/_levenshtein.cpp:119:21: error: too few arguments to function ‘PyCodeObject* PyCode_New(int, int, int, int, int, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, PyObject*, int, PyObject*, PyObject*)’
        119 |           PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
            |           ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      leven/_levenshtein.cpp:2469:15: note: in expansion of macro ‘__Pyx_PyCode_New’
       2469 |     py_code = __Pyx_PyCode_New(
            |               ^~~~~~~~~~~~~~~~
      /usr/include/python3.11/cpython/code.h:148:28: note: declared here
        148 | PyAPI_FUNC(PyCodeObject *) PyCode_New(
            |                            ^~~~~~~~~~
      leven/_levenshtein.cpp: In function ‘void __Pyx_AddTraceback(const char*, int, int, const char*)’:
      leven/_levenshtein.cpp:2515:13: error: invalid use of incomplete type ‘PyFrameObject’ {aka ‘struct _frame’}
       2515 |     py_frame->f_lineno = py_line;
            |             ^~
      In file included from /usr/include/python3.11/Python.h:42:
      /usr/include/python3.11/pytypedefs.h:22:16: note: forward declaration of ‘PyFrameObject’ {aka ‘struct _frame’}
         22 | typedef struct _frame PyFrameObject;
            |                ^~~~~~
      error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
      [end of output]

Компилятор новый.

Стоит вообще возиться с устаревшим пакетом или лучше использоваться альтернативы?

Зачем возиться с дохлым пакетом, когда можно пользоваться встроенным модулем csv из стандартной библиотеки?

Последний коммит в пакете leven был 11 лет назад. Он давно уже заброшен и естественно не будет собираться распоследним GCC. Воскрешать его вряд ли имеет смысл.

archie
()