Open p-smith22 opened 4 months ago
I do not have a mac, so it is hard for me to say. Were there any other errors in the logs? My guess is that there was an error compiling the cython files. Maybe you need to install gcc or some other c compiler?
Thank you for the quick reply. I really appreciate it. Here is the entire log from PIP. : `Collecting treverhines-rbf Using cached treverhines-rbf-2024.3.21.tar.gz (791 kB) Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Requirement already satisfied: numpy>=1.10 in /opt/miniconda3/lib/python3.12/site-packages (from treverhines-rbf) (2.0.0) Requirement already satisfied: scipy in /opt/miniconda3/lib/python3.12/site-packages (from treverhines-rbf) (1.13.1) Requirement already satisfied: sympy in /opt/miniconda3/lib/python3.12/site-packages (from treverhines-rbf) (1.12.1) Requirement already satisfied: cython in /opt/miniconda3/lib/python3.12/site-packages (from treverhines-rbf) (3.0.10) Requirement already satisfied: rtree in /opt/miniconda3/lib/python3.12/site-packages (from treverhines-rbf) (1.2.0) Requirement already satisfied: mpmath<1.4.0,>=1.1.0 in /opt/miniconda3/lib/python3.12/site-packages (from sympy->treverhines-rbf) (1.3.0) Building wheels for collected packages: treverhines-rbf Building wheel for treverhines-rbf (pyproject.toml) ... error error: subprocess-exited-with-error
× Building wheel for treverhines-rbf (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [276 lines of output]
Thanks!
Looks like it could be related to this issue: https://github.com/sympy/sympy/pull/25968
Can you try pulling from master again and rebuilding?
This package uses sympy to autogenerate code for the RBFs and their derivatives. Some of the RBFs are generated at build time (the ones in _rbf_ufuncs), and others are generated at runtime. I remade the code in _rbf_ufuncs using the latest version of sympy that includes a patch for the above issue. Hopefully that would fix your build issue. But RBFs built at runtime may still cause an error unless you have the latest version of sympy.
Okay, it seems we are making progress. The package downloaded, but when I tried to run one of your examples in the README as a test, I got the following error message:
Traceback (most recent call last):
File "/opt/miniconda3/lib/python3.12/site-packages/numpy/_core/arrayprint.py", line 34, in <module>
from . import numerictypes as _nt
File "/opt/miniconda3/lib/python3.12/site-packages/numpy/_core/numerictypes.py", line 102, in <module>
from ._type_aliases import (
File "/opt/miniconda3/lib/python3.12/site-packages/numpy/_core/_type_aliases.py", line 38, in <module>
allTypes[_abstract_type_name] = getattr(ma, _abstract_type_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'numpy.core.multiarray' has no attribute 'flexible'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/parker/Desktop/Python/Research4/RBFTest.py", line 26, in <module>
interp = RBFInterpolant(x_obs, u_obs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/site-packages/treverhines_rbf-2024.3.21+1.g37f9f4f-py3.12-macosx-11.0-arm64.egg/rbf/interpolate.py", line 542, in __init__
phi_coeff, poly_coeff, shift, scale = _build_and_solve_systems(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/site-packages/treverhines_rbf-2024.3.21+1.g37f9f4f-py3.12-macosx-11.0-arm64.egg/rbf/interpolate.py", line 424, in _build_and_solve_systems
poly_coeff *= range_scale[..., None, None]
File "/opt/miniconda3/lib/python3.12/site-packages/numpy/core/_internal.py", line 855, in array_ufunc_errmsg_formatter
args_string = ', '.join(['{!r}'.format(arg) for arg in inputs] +
^^^^^^^^^^^^^^^^^^
RuntimeError: Unable to configure default ndarray.__repr__
It appears to maybe be some compatibility error with numpy?
Those errors look like something is wrong with your numpy installation. Is it otherwise working normally?
What version of numpy are you using? I just realized that numpy 2.0 introduced some breaking changes that I will need to fix eventually. In the meantime, i updated the dependencies to numpy < 2.0.
I believe I got it. I must have had a corrupt download of NumPy, so uninstalling and redownloading it worked. Also, NumPy 2.0 did not work (as you predicted), but reverting to an older version, in this case v1.26.4, worked just fine.
After running some of your example codes, the first one (just RBFInterpolant) compiles just fine and produces the expected graph. The other two examples (PDEs) get the following error (sympy v1.14 and numpy v1.26.4). However, I only expect to use the RBFInterpolant function (which was the example that compiled fine), so I think these fixes should be perfect for me. Thank you so much for the quick replies and an awesome package. I really appreciate it.
Traceback (most recent call last):
File "/opt/miniconda3/lib/python3.12/site-packages/sympy/utilities/autowrap.py", line 182, in _process_files
retoutput = check_output(command, stderr=STDOUT)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/opt/miniconda3/bin/python', 'setup.py', 'build_ext', '--inplace']' returned non-zero exit status 1.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/parker/Desktop/Python/Research4/RBFTest.py", line 27, in <module>
A[groups['interior']] = mq(nodes[groups['interior']], nodes, eps=eps, diff=[2, 0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/site-packages/treverhines_rbf-2024.3.21+2.g396b1ac-py3.12-macosx-11.0-arm64.egg/rbf/basis.py", line 318, in __call__
self._add_diff_to_cache(diff)
File "/opt/miniconda3/lib/python3.12/site-packages/treverhines_rbf-2024.3.21+2.g396b1ac-py3.12-macosx-11.0-arm64.egg/rbf/basis.py", line 423, in _add_diff_to_cache
func = ufuncify(
^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/site-packages/sympy/core/cache.py", line 72, in wrapper
retval = cfunc(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/site-packages/sympy/utilities/autowrap.py", line 1114, in ufuncify
return code_wrapper.wrap_code(routines, helpers=helps)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/miniconda3/lib/python3.12/site-packages/sympy/utilities/autowrap.py", line 837, in wrap_code
self._process_files(routines)
File "/opt/miniconda3/lib/python3.12/site-packages/sympy/utilities/autowrap.py", line 184, in _process_files
raise CodeWrapError(
sympy.utilities.autowrap.CodeWrapError: Error while executing command: /opt/miniconda3/bin/python setup.py build_ext --inplace. Command output is:
running build_ext
building 'wrapper_module_0' extension
creating build
creating build/temp.macosx-11.0-arm64-cpython-312
clang -fno-strict-overflow -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /opt/miniconda3/include -arch arm64 -fPIC -O2 -isystem /opt/miniconda3/include -arch arm64 -I/opt/miniconda3/lib/python3.12/site-packages/numpy/core/include -I/opt/miniconda3/include/python3.12 -c wrapped_code_0.c -o build/temp.macosx-11.0-arm64-cpython-312/wrapped_code_0.o
clang -fno-strict-overflow -DNDEBUG -O2 -Wall -fPIC -O2 -isystem /opt/miniconda3/include -arch arm64 -fPIC -O2 -isystem /opt/miniconda3/include -arch arm64 -I/opt/miniconda3/lib/python3.12/site-packages/numpy/core/include -I/opt/miniconda3/include/python3.12 -c wrapper_module_0.c -o build/temp.macosx-11.0-arm64-cpython-312/wrapper_module_0.o
In file included from wrapper_module_0.c:3:
In file included from /opt/miniconda3/lib/python3.12/site-packages/numpy/core/include/numpy/ndarraytypes.h:1929:
/opt/miniconda3/lib/python3.12/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:17:2: warning: "Using deprecated NumPy API, disable it with " "#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it with " \
^
wrapper_module_0.c:38:56: error: incompatible function pointer types initializing 'PyUFuncGenericFunction' (aka 'void (*)(char **, const long *, const long *, void *)') with an expression of type 'void (*)(char **, npy_intp *, npy_intp *, void *)' (aka 'void (*)(char **, long *, long *, void *)') [-Wincompatible-function-pointer-types]
PyUFuncGenericFunction wrapped_12480489600_funcs[1] = {&wrapped_12480489600_ufunc};
^~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
Im Mac Studio M2 Ultra, and my numpy's version is 1.26.4. I can run example normally. FYI
When attempting to install on macOS (m1 processor), there is an error building the wheels. I am using pip install treverhines-rbf, and the error I am getting is "ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (treverhines-rbf)". I have tried both pip install and trying to download it from the git clone directory in my project folder, and I get the same error for both. Anybody know a way to download on macOS? Thanks.