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

The numpy version in the setup_requires is wrong #974

Open
vnmabus opened this issue Mar 28, 2022 · 0 comments · May be fixed by #975
Open

The numpy version in the setup_requires is wrong #974

vnmabus opened this issue Mar 28, 2022 · 0 comments · May be fixed by #975

Comments

@vnmabus
Copy link

vnmabus commented Mar 28, 2022

The NumPy version in setup_requires should be the oldest supported NumPy version. This way GPy is compiled with that oldest version and you can then use any newer version, as they are ABI compatible.

For that you can specify oldest-supported-numpy as a build dependency in setup_requires instead of numpy, as explained here: https://numpy.org/devdocs/user/depending_on_numpy.html?highlight=mean#build-time-dependency.

The problem if you don't do that is that, if you install GPy along with any other package (such as numba) which cannot use the latest NumPy version, in an environment without NumPy, then GPy will be compiled against the latest NumPy version and THEN the NumPy version will be downgraded, giving the following error on import:

import GPy
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/__init__.py", line 6, in <module>
    from . import core
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/core/__init__.py", line 49, in <module>
    from .gp import GP
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/core/gp.py", line 8, in <module>
    from .. import likelihoods
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/likelihoods/__init__.py", line 25, in <module>
    from .bernoulli import Bernoulli
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/likelihoods/bernoulli.py", line 5, in <module>
    from ..util.univariate_Gaussian import std_norm_pdf, std_norm_cdf, derivLogCdfNormal, logCdfNormal
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/util/__init__.py", line 11, in <module>
    from . import linalg
  File "/home/carlos/Programas/Utilidades/Lenguajes/miniconda3/envs/test_numba/lib/python3.8/site-packages/GPy/util/linalg.py", line 15, in <module>
    from . import linalg_cython
  File "GPy/util/linalg_cython.pyx", line 1, in init GPy.util.linalg_cython
ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 80 from PyObject
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

Successfully merging a pull request may close this issue.

1 participant