erickrf/nlpnet

Python 3.7.3 incompability

alexandredias3d opened this issue · 2 comments

Is it possible to ship the module with newer version of the .c file generated by Cython? I tried to install nlpnet on a Arch Linux (kernel version 5.0.11) using Python version 3.7.3 and got the following error:

long error log

ERROR: Complete output from command /home/user/.virtualenv/locomotive/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ki92nbew/nlpnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-y_o3b2ni --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.7
  creating build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/word_dictionary.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/utils.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/taggers.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/reader.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/metadata.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/config.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/attributes.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/arguments.py -> build/lib.linux-x86_64-3.7/nlpnet
  copying nlpnet/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet
  creating build/lib.linux-x86_64-3.7/nlpnet/pos
  copying nlpnet/pos/pos_reader.py -> build/lib.linux-x86_64-3.7/nlpnet/pos
  copying nlpnet/pos/macmorphoreader.py -> build/lib.linux-x86_64-3.7/nlpnet/pos
  copying nlpnet/pos/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet/pos
  creating build/lib.linux-x86_64-3.7/nlpnet/srl
  copying nlpnet/srl/train_srl.py -> build/lib.linux-x86_64-3.7/nlpnet/srl
  copying nlpnet/srl/srl_reader.py -> build/lib.linux-x86_64-3.7/nlpnet/srl
  copying nlpnet/srl/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet/srl
  creating build/lib.linux-x86_64-3.7/nlpnet/parse
  copying nlpnet/parse/parse_reader.py -> build/lib.linux-x86_64-3.7/nlpnet/parse
  copying nlpnet/parse/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet/parse
  running build_ext
  building 'nlpnet.network' extension
  creating build/temp.linux-x86_64-3.7
  creating build/temp.linux-x86_64-3.7/nlpnet
  gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -I. -I/home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c nlpnet/network.c -o build/temp.linux-x86_64-3.7/nlpnet/network.o
  In file included from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
                   from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                   from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from nlpnet/network.c:274:
  /home/user/.virtualenv/locomotive/lib/python3.7/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]
   #warning "Using deprecated NumPy API, disable it with " \
    ^~~~~~~
  nlpnet/network.c: In function ‘__Pyx__ExceptionSave’:
  nlpnet/network.c:52040:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       *type = tstate->exc_type;
                       ^~~~~~~~
                       curexc_type
  nlpnet/network.c:52041:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       *value = tstate->exc_value;
                        ^~~~~~~~~
                        curexc_value
  nlpnet/network.c:52042:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       *tb = tstate->exc_traceback;
                     ^~~~~~~~~~~~~
                     curexc_traceback
  nlpnet/network.c: In function ‘__Pyx__ExceptionReset’:
  nlpnet/network.c:52049:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       tmp_type = tstate->exc_type;
                          ^~~~~~~~
                          curexc_type
  nlpnet/network.c:52050:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       tmp_value = tstate->exc_value;
                           ^~~~~~~~~
                           curexc_value
  nlpnet/network.c:52051:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       tmp_tb = tstate->exc_traceback;
                        ^~~~~~~~~~~~~
                        curexc_traceback
  nlpnet/network.c:52052:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       tstate->exc_type = type;
               ^~~~~~~~
               curexc_type
  nlpnet/network.c:52053:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       tstate->exc_value = value;
               ^~~~~~~~~
               curexc_value
  nlpnet/network.c:52054:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       tstate->exc_traceback = tb;
               ^~~~~~~~~~~~~
               curexc_traceback
  nlpnet/network.c: In function ‘__Pyx__GetException’:
  nlpnet/network.c:52109:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       tmp_type = tstate->exc_type;
                          ^~~~~~~~
                          curexc_type
  nlpnet/network.c:52110:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       tmp_value = tstate->exc_value;
                           ^~~~~~~~~
                           curexc_value
  nlpnet/network.c:52111:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       tmp_tb = tstate->exc_traceback;
                        ^~~~~~~~~~~~~
                        curexc_traceback
  nlpnet/network.c:52112:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       tstate->exc_type = local_type;
               ^~~~~~~~
               curexc_type
  nlpnet/network.c:52113:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       tstate->exc_value = local_value;
               ^~~~~~~~~
               curexc_value
  nlpnet/network.c:52114:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       tstate->exc_traceback = local_tb;
               ^~~~~~~~~~~~~
               curexc_traceback
  nlpnet/network.c: In function ‘__Pyx__ExceptionSwap’:
  nlpnet/network.c:54637:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       tmp_type = tstate->exc_type;
                          ^~~~~~~~
                          curexc_type
  nlpnet/network.c:54638:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       tmp_value = tstate->exc_value;
                           ^~~~~~~~~
                           curexc_value
  nlpnet/network.c:54639:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       tmp_tb = tstate->exc_traceback;
                        ^~~~~~~~~~~~~
                        curexc_traceback
  nlpnet/network.c:54640:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
       tstate->exc_type = *type;
               ^~~~~~~~
               curexc_type
  nlpnet/network.c:54641:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
       tstate->exc_value = *value;
               ^~~~~~~~~
               curexc_value
  nlpnet/network.c:54642:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
       tstate->exc_traceback = *tb;
               ^~~~~~~~~~~~~
               curexc_traceback
  In file included from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:21,
                   from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                   from nlpnet/network.c:274:
  At top level:
  /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1463:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
   _import_array(void)
   ^~~~~~~~~~~~~
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for nlpnet
    ERROR: Complete output from command /home/user/.virtualenv/locomotive/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ki92nbew/nlpnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jy69pgbc/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/.virtualenv/locomotive/include/site/python3.7/nlpnet:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.7
    creating build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/word_dictionary.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/utils.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/taggers.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/reader.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/metadata.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/config.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/attributes.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/arguments.py -> build/lib.linux-x86_64-3.7/nlpnet
    copying nlpnet/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet
    creating build/lib.linux-x86_64-3.7/nlpnet/pos
    copying nlpnet/pos/pos_reader.py -> build/lib.linux-x86_64-3.7/nlpnet/pos
    copying nlpnet/pos/macmorphoreader.py -> build/lib.linux-x86_64-3.7/nlpnet/pos
    copying nlpnet/pos/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet/pos
    creating build/lib.linux-x86_64-3.7/nlpnet/srl
    copying nlpnet/srl/train_srl.py -> build/lib.linux-x86_64-3.7/nlpnet/srl
    copying nlpnet/srl/srl_reader.py -> build/lib.linux-x86_64-3.7/nlpnet/srl
    copying nlpnet/srl/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet/srl
    creating build/lib.linux-x86_64-3.7/nlpnet/parse
    copying nlpnet/parse/parse_reader.py -> build/lib.linux-x86_64-3.7/nlpnet/parse
    copying nlpnet/parse/__init__.py -> build/lib.linux-x86_64-3.7/nlpnet/parse
    running build_ext
    building 'nlpnet.network' extension
    creating build/temp.linux-x86_64-3.7
    creating build/temp.linux-x86_64-3.7/nlpnet
    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fstack-protector-strong -fno-plt -fPIC -I. -I/home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include -I/usr/include/python3.7m -c nlpnet/network.c -o build/temp.linux-x86_64-3.7/nlpnet/network.o
    In file included from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
                     from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                     from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from nlpnet/network.c:274:
    /home/user/.virtualenv/locomotive/lib/python3.7/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]
     #warning "Using deprecated NumPy API, disable it with " \
      ^~~~~~~
    nlpnet/network.c: In function ‘__Pyx__ExceptionSave’:
    nlpnet/network.c:52040:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         *type = tstate->exc_type;
                         ^~~~~~~~
                         curexc_type
    nlpnet/network.c:52041:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         *value = tstate->exc_value;
                          ^~~~~~~~~
                          curexc_value
    nlpnet/network.c:52042:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         *tb = tstate->exc_traceback;
                       ^~~~~~~~~~~~~
                       curexc_traceback
    nlpnet/network.c: In function ‘__Pyx__ExceptionReset’:
    nlpnet/network.c:52049:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
                            curexc_type
    nlpnet/network.c:52050:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
                             curexc_value
    nlpnet/network.c:52051:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
                          curexc_traceback
    nlpnet/network.c:52052:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = type;
                 ^~~~~~~~
                 curexc_type
    nlpnet/network.c:52053:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = value;
                 ^~~~~~~~~
                 curexc_value
    nlpnet/network.c:52054:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = tb;
                 ^~~~~~~~~~~~~
                 curexc_traceback
    nlpnet/network.c: In function ‘__Pyx__GetException’:
    nlpnet/network.c:52109:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
                            curexc_type
    nlpnet/network.c:52110:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
                             curexc_value
    nlpnet/network.c:52111:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
                          curexc_traceback
    nlpnet/network.c:52112:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = local_type;
                 ^~~~~~~~
                 curexc_type
    nlpnet/network.c:52113:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = local_value;
                 ^~~~~~~~~
                 curexc_value
    nlpnet/network.c:52114:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = local_tb;
                 ^~~~~~~~~~~~~
                 curexc_traceback
    nlpnet/network.c: In function ‘__Pyx__ExceptionSwap’:
    nlpnet/network.c:54637:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tmp_type = tstate->exc_type;
                            ^~~~~~~~
                            curexc_type
    nlpnet/network.c:54638:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tmp_value = tstate->exc_value;
                             ^~~~~~~~~
                             curexc_value
    nlpnet/network.c:54639:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tmp_tb = tstate->exc_traceback;
                          ^~~~~~~~~~~~~
                          curexc_traceback
    nlpnet/network.c:54640:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
         tstate->exc_type = *type;
                 ^~~~~~~~
                 curexc_type
    nlpnet/network.c:54641:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
         tstate->exc_value = *value;
                 ^~~~~~~~~
                 curexc_value
    nlpnet/network.c:54642:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
         tstate->exc_traceback = *tb;
                 ^~~~~~~~~~~~~
                 curexc_traceback
    In file included from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:21,
                     from /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                     from nlpnet/network.c:274:
    At top level:
    /home/user/.virtualenv/locomotive/lib/python3.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1463:1: warning: ‘_import_array’ defined but not used [-Wunused-function]
     _import_array(void)
     ^~~~~~~~~~~~~
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/home/user/.virtualenv/locomotive/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-ki92nbew/nlpnet/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-jy69pgbc/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/.virtualenv/locomotive/include/site/python3.7/nlpnet" failed with error code 1 in /tmp/pip-install-ki92nbew/nlpnet/

I was able to cythonize the network.pyx file using Cython 0.29.7 and use the module.

Still, it would be nice if the module contained a version that is supported by Python 3.7.3 so that it could be easily installed with pip.

I uploaded a new network.c file now. Hopefully that works in any platform and python version.

I think the package is broken (probably missing a platform agnostic nlpnet-1.2.3.tar.gz).

pip install nlpnet==1.2.3
  ERROR: Could not find a version that satisfies the requirement nlpnet==1.2.3 (from versions: 1.2.3.macosx-10.9-x86_64, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.2.0, 1.2.1, 1.2.2)
ERROR: No matching distribution found for nlpnet==1.2.3