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

Python 3.7 Build failure: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? #11

Closed
jonathanunderwood opened this issue Jun 25, 2018 · 12 comments

Comments

@jonathanunderwood
Copy link

pyopengl is currently failing to build on Fedora 29:

https://kojipkgs.fedoraproject.org//work/tasks/3539/27753539/build.log

gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I/builddir/build/BUILD/PyOpenGL-3.1.1a1/PyOpenGL-accelerate-3.1.1a1/.. -I/builddir/build/BUILD/PyOpenGL-3.1.1a1/PyOpenGL-accelerate-3.1.1a1/src -I/builddir/build/BUILD/PyOpenGL-3.1.1a1/PyOpenGL-accelerate-3.1.1a1 -I/usr/include/python3.7m -c src/wrapper.c -o build/temp.linux-x86_64-3.7/src/wrapper.o
src/wrapper.c: In function ‘__Pyx_ExceptionSave’:
src/wrapper.c:11474:21: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     *type = tstate->exc_type;
                     ^~~~~~~~
                     curexc_type
src/wrapper.c:11475:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     *value = tstate->exc_value;
                      ^~~~~~~~~
                      curexc_value
src/wrapper.c:11476:19: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     *tb = tstate->exc_traceback;
                   ^~~~~~~~~~~~~
                   curexc_traceback
src/wrapper.c: In function ‘__Pyx_ExceptionReset’:
src/wrapper.c:11488:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tmp_type = tstate->exc_type;
                        ^~~~~~~~
                        curexc_type
src/wrapper.c:11489:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tmp_value = tstate->exc_value;
                         ^~~~~~~~~
                         curexc_value
src/wrapper.c:11490:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tmp_tb = tstate->exc_traceback;
                      ^~~~~~~~~~~~~
                      curexc_traceback
src/wrapper.c:11491:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tstate->exc_type = type;
             ^~~~~~~~
             curexc_type
src/wrapper.c:11492:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tstate->exc_value = value;
             ^~~~~~~~~
             curexc_value
src/wrapper.c:11493:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = tb;
             ^~~~~~~~~~~~~
             curexc_traceback
src/wrapper.c: In function ‘__Pyx_GetException’:
src/wrapper.c:11536:24: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tmp_type = tstate->exc_type;
                        ^~~~~~~~
                        curexc_type
src/wrapper.c:11537:25: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tmp_value = tstate->exc_value;
                         ^~~~~~~~~
                         curexc_value
src/wrapper.c:11538:22: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tmp_tb = tstate->exc_traceback;
                      ^~~~~~~~~~~~~
                      curexc_traceback
src/wrapper.c:11539:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tstate->exc_type = local_type;
             ^~~~~~~~
             curexc_type
src/wrapper.c:11540:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tstate->exc_value = local_value;
             ^~~~~~~~~
             curexc_value
src/wrapper.c:11541:13: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = local_tb;
             ^~~~~~~~~~~~~
             curexc_traceback
error: command 'gcc' failed with exit status 1
@jonathanunderwood
Copy link
Author

I see this is a Cython issue - incompatibility with Python 3.7. Cython report:

cython/cython#1955

Looks like Cython >= 0.27.3 is needed on Python 3.7. Will close this.

@jonathanunderwood
Copy link
Author

Actually, Cython isn't used when building pyopengl. So, re-opening. This looks like a Python 3.7 incompatibility.

@jonathanunderwood jonathanunderwood changed the title Build failure: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? Python 3.7 Build failure: error: ‘PyThreadState’ {aka ‘struct _ts’} has no member named ‘exc_type’; did you mean ‘curexc_type’? Jun 25, 2018
@serhiy-storchaka
Copy link

These files are generated by Cython. Just upgrade Cython to the version that supports Python 3.7 and regenerate files.

@EpicWink
Copy link
Contributor

EpicWink commented May 11, 2019

In addition, you'll need PyOpenGL-accelerate v3.1 pre-release at least (currently v3.1.3b1) if you're getting it from PyPI

Edit: v3.1.3rc1 as of 2019-12-02

@bmurauer
Copy link

I still get the same error message, i have:

  • python 3.7.3
  • cython 0.29.7
  • PyOpenGL-accelerate 3.1.3b1
  • pip 19.0.3

@EpicWink
Copy link
Contributor

EpicWink commented May 24, 2019

I still get the same error message, i have:

...

The only difference between your environment and mine is I have pip v19.1.1 (and of course I have numpy v1.16.3) @bmurauer

@ambareeshsrja16
Copy link

Getting the same error, is there a work around for this?

@the-lost-explorer
Copy link

Solved.
Inside PyOpenGL_accelerate/src,

Change all occurrences, highlighted in the error message above, of exc_type, exc_value, exc_traceback to curexc_type, curexc_value, curexc_traceback respectively. (Generally found only inside wrapper.c, vbo.c, formathandler.c and numpy_formathandler.c )

@mikulas-mrva
Copy link

Updating pip to latest version (19.3.1 at the moment) fixed this for me.

@mcfletch
Copy link
Owner

I believe these issues were addressed in the latest release. PyOpenGL_accelerate compiles on python3.7 with the updated cython 0.29.4 generated bindings.

@Bugatti100Peagle
Copy link

When I want to install Basemap on jupyterlab, also Bug
I haved install geos, pillow, pyporj

In file included from src/_geoslib.c:248:0:
/usr/local/include/geos_c.h:149:22: note: expected ‘GEOSMessageHandler {aka void (*)(const char *)}’ but argument is of type ‘void (*)(char *, char *)’
 extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function,
                      ^~~~~~~~
src/_geoslib.c: In function ‘__Pyx_ExceptionSave’:
src/_geoslib.c:5552:21: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
     *type = tstate->exc_type;
                     ^~~~~~~~
                     curexc_type
src/_geoslib.c:5553:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
     *value = tstate->exc_value;
                      ^~~~~~~~~
                      curexc_value
src/_geoslib.c:5554:19: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     *tb = tstate->exc_traceback;
                   ^~~~~~~~~~~~~
                   curexc_traceback
src/_geoslib.c: In function ‘__Pyx_ExceptionReset’:
src/_geoslib.c:5566:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tmp_type = tstate->exc_type;
                        ^~~~~~~~
                        curexc_type
src/_geoslib.c:5567:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tmp_value = tstate->exc_value;
                         ^~~~~~~~~
                         curexc_value
src/_geoslib.c:5568:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tmp_tb = tstate->exc_traceback;
                      ^~~~~~~~~~~~~
                      curexc_traceback
src/_geoslib.c:5569:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tstate->exc_type = type;
             ^~~~~~~~
             curexc_type
src/_geoslib.c:5570:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tstate->exc_value = value;
             ^~~~~~~~~
             curexc_value
src/_geoslib.c:5571:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = tb;
             ^~~~~~~~~~~~~
             curexc_traceback
src/_geoslib.c: In function ‘__Pyx_GetException’:
src/_geoslib.c:5614:24: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tmp_type = tstate->exc_type;
                        ^~~~~~~~
                        curexc_type
src/_geoslib.c:5615:25: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tmp_value = tstate->exc_value;
                         ^~~~~~~~~
                         curexc_value
src/_geoslib.c:5616:22: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tmp_tb = tstate->exc_traceback;
                      ^~~~~~~~~~~~~
                      curexc_traceback
src/_geoslib.c:5617:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_type’; did you mean ‘curexc_type’?
     tstate->exc_type = local_type;
             ^~~~~~~~
             curexc_type
src/_geoslib.c:5618:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_value’; did you mean ‘curexc_value’?
     tstate->exc_value = local_value;
             ^~~~~~~~~
             curexc_value
src/_geoslib.c:5619:13: error: ‘PyThreadState {aka struct _ts}’ has no member named ‘exc_traceback’; did you mean ‘curexc_traceback’?
     tstate->exc_traceback = local_tb;
             ^~~~~~~~~~~~~
             curexc_traceback
error: Command "gcc -pthread -B /opt/conda/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I['/opt/conda/lib/python3.7/site-packages/numpy/core/include'] -I/opt/conda/lib/python3.7/site-packages/numpy/core/include -I/opt/conda/include/python3.7m -c src/_geoslib.c -o build/temp.linux-x86_64-3.7/src/_geoslib.o -MMD -MF build/temp.linux-x86_64-3.7/src/_geoslib.o.d" failed with exit status 1

@monacv
Copy link

monacv commented Jan 13, 2021

I get same issue https://pastebin.com/raw/3iPH54Vh

$ pip --version
pip 20.0.2 from /home/mona/venv/tsdf/lib/python3.8/site-packages/pip (python 3.8)
$ python
Python 3.8.5 (default, Jul 28 2020, 12:59:40) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cython
>>> cython.__version__
'0.29.21'

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

No branches or pull requests

10 participants