Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mappy Python3.9 - pip installation error #719

Closed
vepain opened this issue Mar 23, 2021 · 5 comments · Fixed by #723
Closed

Mappy Python3.9 - pip installation error #719

vepain opened this issue Mar 23, 2021 · 5 comments · Fixed by #723

Comments

@vepain
Copy link

vepain commented Mar 23, 2021

Hi @lh3,

I really like your work on minimap2 and I currently work on a new long reads assembly method for my PhD which use your aligner, so thank you!

I use python3.9 for all my code until I meet time or memory complexity issues.
That's why I used python3.9 -m pip install mappy but it returns an exit status 1.

It seems to be due to error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’ (see https://bugs.python.org/issue39361) and some depreciated PyUnicode[...] objects perhaps.

You can see the complete compilation error print below:

Installing collected packages: mappy
    Running setup.py install for mappy ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/profchep/.tmp/pip-install-njiwcsf4/mappy_cc02fcf058a842b4a850abdd4bcd75a6/setup.py'"'"'; __file__='"'"'/home/profchep/.tmp/pip-install-njiwcsf4/mappy_cc02fcf058a842b4a850abdd4bcd75a6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /home/profchep/.tmp/pip-record-vlanbkky/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/profchep/.local/include/python3.9/mappy
         cwd: /home/profchep/.tmp/pip-install-njiwcsf4/mappy_cc02fcf058a842b4a850abdd4bcd75a6/
    Complete output (230 lines):
    running install
    running build
    running build_ext
    skipping 'python/mappy.c' Cython extension (up-to-date)
    building 'mappy' extension
    creating build
    creating build/temp.linux-x86_64-3.9
    creating build/temp.linux-x86_64-3.9/python
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c align.c -o build/temp.linux-x86_64-3.9/align.o -DHAVE_KALLOC -msse4.1
    align.c: In function ‘mm_get_hplen_back’:
    align.c:346:29: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
      346 |   if (mm_seq4_get(mi->S, i) != c) break;
          |                             ^~
    align.c: In function ‘mm_seed_ext_score’:
    align.c:533:49: warning: operand of ?: changes signedness from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      533 |  re = re + ext_len < (int32_t)mi->seq[rid].len? re + ext_len : mi->seq[rid].len;
          |                                                 ^~~~~~~~~~~~
    align.c: In function ‘mm_align1’:
    align.c:620:45: warning: operand of ?: changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      620 |   re0 = re + l < (int32_t)mi->seq[rid].len? re + l : mi->seq[rid].len;
          |                                             ^~~~~~
    align.c:672:44: warning: operand of ?: changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      672 |    l = l < (int32_t)mi->seq[rid].len - re? l : mi->seq[rid].len - re;
          |                                            ^
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c bseq.c -o build/temp.linux-x86_64-3.9/bseq.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c chain.c -o build/temp.linux-x86_64-3.9/chain.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c esterr.c -o build/temp.linux-x86_64-3.9/esterr.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c format.c -o build/temp.linux-x86_64-3.9/format.o -DHAVE_KALLOC -msse4.1
    format.c: In function ‘mm_event_identity’:
    format.c:268:16: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
      268 |  for (i = 0; i < r->p->n_cigar; ++i) {
          |                ^
    format.c: In function ‘mm_write_sam3’:
    format.c:391:36: warning: variable ‘this_rev’ set but not used [-Wunused-but-set-variable]
      391 |  int this_rid = -1, this_pos = -1, this_rev = 0;
          |                                    ^~~~~~~~
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c hit.c -o build/temp.linux-x86_64-3.9/hit.o -DHAVE_KALLOC -msse4.1
    hit.c: In function ‘mm_hit_sort’:
    hit.c:171:48: warning: variable ‘no_cigar’ set but not used [-Wunused-but-set-variable]
      171 |  int32_t i, n_aux, n = *n_regs, has_cigar = 0, no_cigar = 0;
          |                                                ^~~~~~~~
    hit.c:171:33: warning: variable ‘has_cigar’ set but not used [-Wunused-but-set-variable]
      171 |  int32_t i, n_aux, n = *n_regs, has_cigar = 0, no_cigar = 0;
          |                                 ^~~~~~~~~
    hit.c: In function ‘mm_join_long’:
    hit.c:324:40: warning: operand of ?: changes signedness from ‘int’ to ‘uint64_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      324 |   max_gap = a0e->x + max_gap > a1s->x? max_gap : a1s->x - a0e->x;
          |                                        ^~~~~~~
    hit.c:325:40: warning: operand of ?: changes signedness from ‘int’ to ‘uint64_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      325 |   min_gap = a0e->x + min_gap < a1s->x? min_gap : a1s->x - a0e->x;
          |                                        ^~~~~~~
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c index.c -o build/temp.linux-x86_64-3.9/index.o -DHAVE_KALLOC -msse4.1
    index.c: In function ‘mm_idx_name2id’:
    index.c:149:25: warning: operand of ?: changes signedness from ‘int’ to ‘uint32_t’ {aka ‘unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      149 |  return k == kh_end(h)? -1 : kh_val(h, k);
          |                         ^~
    index.c: In function ‘mm_idx_gen’:
    index.c:358:63: warning: operand of ?: changes signedness from ‘int’ to ‘uint64_t’ {aka ‘long unsigned int’} due to unsignedness of other operand [-Wsign-compare]
      358 |  pl.mini_batch_size = (uint64_t)mini_batch_size < batch_size? mini_batch_size : batch_size;
          |                                                               ^~~~~~~~~~~~~~~
    index.c: In function ‘mm_idx_dump’:
    index.c:458:16: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
      458 |  for (i = 0; i < 1<<mi->b; ++i) {
          |                ^
    index.c: In function ‘mm_idx_load’:
    index.c:505:16: warning: comparison of integer expressions of different signedness: ‘uint32_t’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
      505 |  for (i = 0; i < 1<<mi->b; ++i) {
          |                ^
    index.c: In function ‘mm_idx_bed_read’:
    index.c:698:16: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘unsigned int’} [-Wsign-compare]
      698 |  for (i = 0; i < mi->n_seq; ++i) // TODO: eliminate redundant intervals
          |                ^
    index.c: In function ‘mm_idx_bed_junc’:
    index.c:708:35: warning: comparison of integer expressions of different signedness: ‘int32_t’ {aka ‘int’} and ‘uint32_t’ {aka ‘const unsigned int’} [-Wsign-compare]
      708 |  if (mi->I == 0 || ctg < 0 || ctg >= mi->n_seq) return -1;
          |                                   ^~
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c kalloc.c -o build/temp.linux-x86_64-3.9/kalloc.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c ksw2_extd2_sse.c -o build/temp.linux-x86_64-3.9/ksw2_extd2_sse.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c ksw2_exts2_sse.c -o build/temp.linux-x86_64-3.9/ksw2_exts2_sse.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c ksw2_extz2_sse.c -o build/temp.linux-x86_64-3.9/ksw2_extz2_sse.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c ksw2_ll_sse.c -o build/temp.linux-x86_64-3.9/ksw2_ll_sse.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c kthread.c -o build/temp.linux-x86_64-3.9/kthread.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c map.c -o build/temp.linux-x86_64-3.9/map.o -DHAVE_KALLOC -msse4.1
    map.c: In function ‘mm_dust_minier’:
    map.c:52:42: warning: operand of ?: changes signedness from ‘int32_t’ {aka ‘int’} to ‘uint64_t’ {aka ‘const long unsigned int’} due to unsignedness of other operand [-Wsign-compare]
       52 |     int ss = s > (int32_t)(dreg[v]>>32)? s : dreg[v]>>32;
          |                                          ^
    map.c:53:36: warning: operand of ?: changes signedness from ‘int32_t’ {aka ‘int’} to ‘unsigned int’ due to unsignedness of other operand [-Wsign-compare]
       53 |     int ee = e < (int32_t)dreg[v]? e : (uint32_t)dreg[v];
          |                                    ^
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c misc.c -o build/temp.linux-x86_64-3.9/misc.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c options.c -o build/temp.linux-x86_64-3.9/options.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c pe.c -o build/temp.linux-x86_64-3.9/pe.o -DHAVE_KALLOC -msse4.1
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I. -I/usr/include/python3.9 -c python/mappy.c -o build/temp.linux-x86_64-3.9/python/mappy.o -DHAVE_KALLOC -msse4.1
    python/mappy.c: In function ‘__Pyx_modinit_type_init_code’:
    python/mappy.c:8053:30: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8053 |   __pyx_type_5mappy_Alignment.tp_print = 0;
          |                              ^
    python/mappy.c:8061:33: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8061 |   __pyx_type_5mappy_ThreadBuffer.tp_print = 0;
          |                                 ^
    python/mappy.c:8069:28: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8069 |   __pyx_type_5mappy_Aligner.tp_print = 0;
          |                            ^
    python/mappy.c:8077:44: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8077 |   __pyx_type_5mappy___pyx_scope_struct__map.tp_print = 0;
          |                                            ^
    python/mappy.c:8083:52: error: ‘PyTypeObject’ {aka ‘struct _typeobject’} has no member named ‘tp_print’
     8083 |   __pyx_type_5mappy___pyx_scope_struct_1_fastx_read.tp_print = 0;
          |                                                    ^
    python/mappy.c: In function ‘__Pyx_ParseOptionalKeywords’:
    python/mappy.c:8550:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8550 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8550:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
     8550 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    python/mappy.c:8550:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8550 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8550:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8550 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8550:21: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
     8550 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    python/mappy.c:8550:21: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8550 |                     (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                     ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8566:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8566 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8566:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
     8566 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    python/mappy.c:8566:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8566 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8566:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8566 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c:8566:25: warning: ‘PyUnicode_AsUnicode’ is deprecated [-Wdeprecated-declarations]
     8566 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:580:45: note: declared here
      580 | Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode(
          |                                             ^~~~~~~~~~~~~~~~~~~
    python/mappy.c:8566:25: warning: ‘_PyUnicode_get_wstr_length’ is deprecated [-Wdeprecated-declarations]
     8566 |                         (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
          |                         ^
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:446:26: note: declared here
      446 | static inline Py_ssize_t _PyUnicode_get_wstr_length(PyObject *op) {
          |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    python/mappy.c: In function ‘__Pyx_decode_c_string’:
    python/mappy.c:10261:9: warning: ‘PyUnicode_FromUnicode’ is deprecated [-Wdeprecated-declarations]
    10261 |         return PyUnicode_FromUnicode(NULL, 0);
          |         ^~~~~~
    In file included from /usr/include/python3.9/unicodeobject.h:1026,
                     from /usr/include/python3.9/Python.h:97,
                     from python/mappy.c:4:
    /usr/include/python3.9/cpython/unicodeobject.h:551:42: note: declared here
      551 | Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
          |                                          ^~~~~~~~~~~~~~~~~~~~~
    error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/profchep/.tmp/pip-install-njiwcsf4/mappy_cc02fcf058a842b4a850abdd4bcd75a6/setup.py'"'"'; __file__='"'"'/home/profchep/.tmp/pip-install-njiwcsf4/mappy_cc02fcf058a842b4a850abdd4bcd75a6/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /home/profchep/.tmp/pip-record-vlanbkky/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/profchep/.local/include/python3.9/mappy Check the logs for full command output.

Thank you for your help and your time,
Best regards

@lh3
Copy link
Owner

lh3 commented Mar 23, 2021

I don't know what is the cause. Python 3.9 in Travis compiles mappy without problems.

@jmarshall
Copy link
Contributor

The tp_print errors are in mappy.c, and:

skipping 'python/mappy.c' Cython extension (up-to-date)

mappy.c has been generated by an older version of Cython that is not fully compatible with Python 3.9. It's unclear whether that means @vepain needs to update Cython on their machine or that the problem is that mappy.c was generated elsewhere and just needs to be regenerated locally.

@vepain
Copy link
Author

vepain commented Mar 24, 2021

Thank you two for your answer,

In fact, I can install correctly mappy for python3.8 which not has Cython in package library (perhaps in python version directly, I don't really know how Cython is related to Python depending of the installation way)

However, for python3.9, Cython version is 0.29.21 (up-to-date)

$: python3.9 -m pip freeze | grep 'Cython'
Cython==0.29.21

@marcus1487
Copy link
Contributor

From the python issue linked above, it appears that the issue is not with cython, but with the python version used to compile the mappy cython found in pypi. The released mappy package in pypi appears to use the most recent cython version (0.29 from the files header), but was probably compiled with an older version of python (not listed in the cython header that I can find). I suspect the pypi package will have to be submitted from a python3.9 compiled distribution in order to resolve this issue. This could create backwards compatibility issues with older versions of python and may have to be tested.

@lh3 lh3 closed this as completed in #723 Apr 5, 2021
@lh3 lh3 added the enhancement label Apr 5, 2021
@lh3
Copy link
Owner

lh3 commented Apr 5, 2021

I have just merged @marcus1487's #723. With this PR, pip install mappy will also install cython. @marcus1487 has tested that this should fix the issue. I will update the PyPI package when I release 2.18 hopefully later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants