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

Explain numpy version requirement #136

Open
yannrichet opened this issue Nov 19, 2021 · 1 comment
Open

Explain numpy version requirement #136

yannrichet opened this issue Nov 19, 2021 · 1 comment

Comments

@yannrichet
Copy link
Member

version 1.17 seems too old:

$ python3
Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pylibkriging as lk
>>> import numpy as np
>>> X = [0.0, 0.2, 0.5, 0.8, 1.0]
>>> f = lambda x: (1 - 1 / 2 * (np.sin(12 * x) / (1 + x) + 2 * np.cos(7 * x) * x ** 5 + 0.7))
>>> y = [f(xi) for xi in X]
>>> 
>>> import pylibkriging as lk
>>> k_py = lk.Kriging(y, X, "gauss")
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: <built-in method __init__ of PyCapsule object at 0x7fb0c53586f0> returned a result with an error set
>>> print(k_py.describeModel())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'k_py' is not defined
>>> 
$ pip3 show numpy
Name: numpy
Version: 1.17.4
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: /usr/lib/python3/dist-packages
Requires: 
Required-by: scikit-learn, pylibkriging, Funz, scipy, PyWavelets, opencv-python, matplotlib

@hpwxf hpwxf changed the title Should require numpy version Explain numpy version requirement Feb 3, 2022
@hpwxf
Copy link
Member

hpwxf commented Apr 7, 2022

It could be better if we decrease numpy version constraints. To do so, libKriging should be compiled with a defined numpy version (not latest). To install a precise version of numpy, one can do something like:

pip3 install numpy==1.20

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

No branches or pull requests

2 participants