GPy: GPy failes to build

Hi! on my machine GPy failes to build with the following error:

➜  GPy git:(devel) python3 setup.py develop
running develop
running egg_info
creating GPy.egg-info
writing GPy.egg-info/PKG-INFO
writing dependency_links to GPy.egg-info/dependency_links.txt
writing requirements to GPy.egg-info/requires.txt
writing top-level names to GPy.egg-info/top_level.txt
writing manifest file 'GPy.egg-info/SOURCES.txt'
reading manifest file 'GPy.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'README.rst'
writing manifest file 'GPy.egg-info/SOURCES.txt'
running build_ext
skipping 'GPy/kern/src/stationary_cython.c' Cython extension (up-to-date)
skipping 'GPy/util/choleskies_cython.c' Cython extension (up-to-date)
skipping 'GPy/util/linalg_cython.c' Cython extension (up-to-date)
skipping 'GPy/kern/src/coregionalize_cython.c' Cython extension (up-to-date)
skipping 'GPy/models/state_space_cython.c' Cython extension (up-to-date)
building 'GPy.kern.src.stationary_cython' extension
creating build
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/GPy
creating build/temp.linux-x86_64-3.9/GPy/kern
creating build/temp.linux-x86_64-3.9/GPy/kern/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fno-semantic-interposition -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fPIC -I/usr/lib/python3.9/site-packages/numpy/core/include -I. -I/usr/include/python3.9 -c GPy/kern/src/stationary_cython.c -o build/temp.linux-x86_64-3.9/GPy/kern/src/stationary_cython.o -fopenmp -O3
In Datei, eingebunden von /usr/lib/python3.9/site-packages/numpy/core/include/numpy/ndarraytypes.h:1822,
                 von /usr/lib/python3.9/site-packages/numpy/core/include/numpy/ndarrayobject.h:12,
                 von /usr/lib/python3.9/site-packages/numpy/core/include/numpy/arrayobject.h:4,
                 von GPy/kern/src/stationary_cython.c:613:
/usr/lib/python3.9/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: Warnung: #warning "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
   17 | #warning "Using deprecated NumPy API, disable it with " \
      |  ^~~~~~~
GPy/kern/src/stationary_cython.c: In Funktion »__Pyx_InitGlobals«:
GPy/kern/src/stationary_cython.c:20142:1: Warnung: »PyEval_InitThreads« ist veraltet [-Wdeprecated-declarations]
20142 | PyEval_InitThreads();
      | ^~~~~~~~~~~~~~~~~~
In Datei, eingebunden von /usr/include/python3.9/Python.h:145,
                 von GPy/kern/src/stationary_cython.c:4:
/usr/include/python3.9/ceval.h:130:37: Anmerkung: hier deklariert
  130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
      |                                     ^~~~~~~~~~~~~~~~~~
GPy/kern/src/stationary_cython.c: In Funktion »__Pyx_modinit_type_init_code«:
GPy/kern/src/stationary_cython.c:20201:25: Fehler: »PyTypeObject« {alias »struct _typeobject«} hat kein Element namens »tp_print«
20201 |   __pyx_type___pyx_array.tp_print = 0;
      |                         ^
GPy/kern/src/stationary_cython.c:20206:31: Fehler: »PyTypeObject« {alias »struct _typeobject«} hat kein Element namens »tp_print«
20206 |   __pyx_type___pyx_MemviewEnum.tp_print = 0;
      |                               ^
GPy/kern/src/stationary_cython.c:20221:30: Fehler: »PyTypeObject« {alias »struct _typeobject«} hat kein Element namens »tp_print«
20221 |   __pyx_type___pyx_memoryview.tp_print = 0;
      |                              ^
GPy/kern/src/stationary_cython.c:20234:35: Fehler: »PyTypeObject« {alias »struct _typeobject«} hat kein Element namens »tp_print«
20234 |   __pyx_type___pyx_memoryviewslice.tp_print = 0;
      |                                   ^

Is this related to python 3.9?

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 15 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Definitely alive.

And still very widely used.

Just not got a single official maintainer currently. But feel free to continue contributing!

Neil — Professor Neil Lawrence http://inverseprobability.com


From: joergbuchwald notifications@github.com Sent: Monday, January 18, 2021 12:47:58 PM To: SheffieldML/GPy GPy@noreply.github.com Cc: Subscribed subscribed@noreply.github.com Subject: Re: [SheffieldML/GPy] GPy failes to build (#881)

3.8.5 worked for me as well. However, it seems like there hasn’t been any activity for over two months now, so I’m wondering whether GPy is still alive.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/SheffieldML/GPy/issues/881#issuecomment-762229573, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AABAUWVJI64LQTELIKJPR4TS2QUX5ANCNFSM4VEOLWAQ.

+1 To the solution proposed by @ekalosak

git clone -b ekalosak/python39 https://github.com/ekalosak/GPy.git
cd GPy
pip install -e .

Hey y’all, 1.10.0 has been released and has python 3.9 support, I’m closing this issue.

pip install --upgrade GPy to get the latest.

Thanks for checking in. I’ll get on to this!

Is this just as straightforward as updating the release in PyPi after adding 3.9 to the CI (#888)?

It’s even more straightforward than that. The maintainers just need to tag and release a new version (like 1.9.10). As people found out, Python can build local wheels from source.

This cannot be fixed by outside contribution. This needs @lawrennd or someone else with access to the repo to make a release.

Is this just as straightforward as updating the release in PyPi after adding 3.9 to the CI (https://github.com/SheffieldML/GPy/pull/888)?

Screen Shot 2021-02-06 at 5 02 58 PM

EDIT: looks like it was a little more complicated. I updated the cython-generated c files that used the ❤️.9 method tp_print by running setup.py using 3.9. Before doing this, pip install -e . failed with the same 4 errors above. After running setup.py with python3.9, the errors are gone and it installs fine. Given that updating these c files via setup.py was the only intervention I applied, I’m concluding that this was the correct intervention. Furthermore, I’ve checked installation using python 3.8.1 on the updated c files and it works, so it looks like this change is backwards compatible.

@mzwiessele @lawrennd @zhenwendai @javiergonzalezh @apaleyes please release the 3.9 update to PyPi so folks can pip install GPy 🙏

So, if there are no maintainers, and gpy won’t compile with Python 3.9… ?

a temporary fix is to create a conda environment with a previous version of python – 3.6 will definitely work.

instructions for creating a working conda environment for GPy can be found here: http://gpss.cc/gpss20/getting_started

I can confirm I’m getting the same errors with Python 3.9 and Clang:

GPy/kern/src/stationary_cython.c:20201:26: error: no member named 'tp_print' in 'struct _typeobject'
  __pyx_type___pyx_array.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~ ^
GPy/kern/src/stationary_cython.c:20206:32: error: no member named 'tp_print' in 'struct _typeobject'
  __pyx_type___pyx_MemviewEnum.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
GPy/kern/src/stationary_cython.c:20221:31: error: no member named 'tp_print' in 'struct _typeobject'
  __pyx_type___pyx_memoryview.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
GPy/kern/src/stationary_cython.c:20234:36: error: no member named 'tp_print' in 'struct _typeobject'
  __pyx_type___pyx_memoryviewslice.tp_print = 0;
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^