glove-python icon indicating copy to clipboard operation
glove-python copied to clipboard

Error Installing with Python 3.7

Open rjhubbard88 opened this issue 5 years ago • 4 comments

When running pip install python on Linux Mint 19:

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/glove copying glove/glove.py -> build/lib.linux-x86_64-3.7/glove copying glove/corpus.py -> build/lib.linux-x86_64-3.7/glove copying glove/init.py -> build/lib.linux-x86_64-3.7/glove running build_ext building 'glove.glove_cython' extension creating build/temp.linux-x86_64-3.7 creating build/temp.linux-x86_64-3.7/glove gcc -pthread -B /home/rjhubba2/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/rjhubba2/anaconda3/include/python3.7m -c glove/glove_cython.c -o build/temp.linux-x86_64-3.7/glove/glove_cython.o -fopenmp -ffast-math -march=native glove/glove_cython.c: In function ‘__Pyx_ExceptionSave’: glove/glove_cython.c:16753:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? *type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16754:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? *value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16755:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? *tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c: In function ‘__Pyx_ExceptionReset’: glove/glove_cython.c:16767:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tmp_type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16768:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16769:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c:16770:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tstate->exc_type = type; ^~~~~~~~ curexc_type glove/glove_cython.c:16771:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tstate->exc_value = value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16772:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tstate->exc_traceback = tb; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c: In function ‘__Pyx_GetException’: glove/glove_cython.c:16815:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tmp_type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16816:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16817:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c:16818:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tstate->exc_type = local_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16819:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tstate->exc_value = local_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16820:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tstate->exc_traceback = local_tb; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c: In function ‘__Pyx_ExceptionSwap’: glove/glove_cython.c:16842:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tmp_type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16843:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16844:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c:16845:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tstate->exc_type = *type; ^~~~~~~~ curexc_type glove/glove_cython.c:16846:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tstate->exc_value = *value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16847:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tstate->exc_traceback = *tb; ^~~~~~~~~~~~~ curexc_traceback error: command 'gcc' failed with exit status 1


Failed building wheel for glove-python Running setup.py clean for glove-python Complete output from command /home/rjhubba2/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-v8bbfpp6/glove-python/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" clean --all: usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...] or: -c --help [cmd1 cmd2 ...] or: -c --help-commands or: -c cmd --help

error: option --all not recognized


Failed cleaning build dir for glove-python Failed to build glove-python Installing collected packages: glove-python Running setup.py install for glove-python ... error Complete output from command /home/rjhubba2/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-install-v8bbfpp6/glove-python/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-1ktnwkqo/install-record.txt --single-version-externally-managed --compile: running install running build running build_py running build_ext building 'glove.glove_cython' extension gcc -pthread -B /home/rjhubba2/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/rjhubba2/anaconda3/include/python3.7m -c glove/glove_cython.c -o build/temp.linux-x86_64-3.7/glove/glove_cython.o -fopenmp -ffast-math -march=native glove/glove_cython.c: In function ‘__Pyx_ExceptionSave’: glove/glove_cython.c:16753:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? *type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16754:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? *value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16755:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? *tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c: In function ‘__Pyx_ExceptionReset’: glove/glove_cython.c:16767:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tmp_type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16768:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16769:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c:16770:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tstate->exc_type = type; ^~~~~~~~ curexc_type glove/glove_cython.c:16771:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tstate->exc_value = value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16772:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tstate->exc_traceback = tb; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c: In function ‘__Pyx_GetException’: glove/glove_cython.c:16815:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tmp_type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16816:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16817:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c:16818:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tstate->exc_type = local_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16819:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tstate->exc_value = local_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16820:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tstate->exc_traceback = local_tb; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c: In function ‘__Pyx_ExceptionSwap’: glove/glove_cython.c:16842:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tmp_type = tstate->exc_type; ^~~~~~~~ curexc_type glove/glove_cython.c:16843:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tmp_value = tstate->exc_value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16844:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tmp_tb = tstate->exc_traceback; ^~~~~~~~~~~~~ curexc_traceback glove/glove_cython.c:16845:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? tstate->exc_type = *type; ^~~~~~~~ curexc_type glove/glove_cython.c:16846:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’? tstate->exc_value = *value; ^~~~~~~~~ curexc_value glove/glove_cython.c:16847:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’? tstate->exc_traceback = *tb; ^~~~~~~~~~~~~ curexc_traceback error: command 'gcc' failed with exit status 1


As far as I can tell from people posting about this error, this is because these files are generated by an older version of Cython that is not compatible with Python 3.7. If you upgrade Cython to the version that supports Python 3.7 and regenerate files, supposedly this will work.

rjhubbard88 avatar Apr 11 '19 14:04 rjhubbard88

Hello,

I got the exact same error when trying to install this repo with python3.7

I went through this by recompiling all .pyx files of the project, with cython>=0.29.X installed.

cython glove_cython.pyx
cythonize glove_cython.pyx

cython metrics/accuracy_cython.pyx
cythonize metrics/accuracy_cython.pyx

cython corpus_cython.pyx
cythonize corpus_cython.pyx

When it comes to "corpus_cython.pyx" you must get some synthax errors on c++. I did not know how to fix them, so I just removed the lines concerned. Then it worked. However, you may not be able to use corpus... It would be good to fix these errors and propose a solution.

ftorregrossa avatar Apr 16 '19 08:04 ftorregrossa

Hi, Might be a bit too late for you, but I found the solution to this problem with c++ errors. Do what @ftorregrossa said, but when it comes to cython corpus_cython.pyx, run cython --cplus corpus_cython.pyx instead. After that, cd .. then python setup.py cythonize, as written under Development in README. Then, just running make should work.

Aonnghus avatar Jun 07 '19 10:06 Aonnghus

@maciejkula can you please fix this and update the package on pypi? The whole world is depending on this.

fredericoschardong avatar Mar 19 '21 01:03 fredericoschardong

Here is a fork with this updated to work in python 3.8. It took me a lot to get it working, hope it helps someone out there: https://github.com/7Puentes/glove-python (it also includes minor changes, but shouldn't break anything)

Redithion avatar Apr 12 '21 20:04 Redithion