Fixing extra/python-tensorflow, which is incompatible to python-numpy 2.0
Dear AUR folks, Last week, the python-numpy package was upgraded to v2.0. Since then, extra/python-tensorflow [1] has been raising a runtime error: ```sh $ sudo pacman -Syu python-tensorflow […] $ pacman -Q python-tensorflow python-numpy python-tensorflow 2.16.1-9 python-numpy 2.0.0-1 $ /usr/bin/python -c 'import tensorflow' […] File "/usr/lib/python3.12/site-packages/tensorflow/python/ops/numpy_ops/np_dtypes.py", line 30, in <module> complex_ = np.complex_ ^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/numpy/__init__.py", line 397, in __getattr__ raise AttributeError( AttributeError: `np.complex_` was removed in the NumPy 2.0 release. Use `np.complex128` instead.. Did you mean: 'complex64'? ``` For the full output, see: https://0x0.st/Xa9Q.log Given that upstream is still working on NumPy 2 support [2], the error message makes sense. Users can fix this incompatibility for themselves by either a) manually downgrading `python-numpy` to v1.x from their cache; or b) installing `python-numpy1` [3] from the AUR, which I uploaded today. Judging from the progress of the upstream issue [2], NumPy v2 support in tensorflow may not be exactly around the corner. Until then, users are going to have a hard time figuring out one of these workarounds on their own. I think all packages from core and extra are supposed to Just Work. So I wonder what might be a more user-friendly way to fix `extra/python-tensorflow` for everyone? Would it make sense to move `python-numpy1` from the AUR to `extra` to allow `python-tensorflow` to depend on `python-numpy1`? [1]: https://archlinux.org/packages/extra/x86_64/python-tensorflow/ [2]: https://github.com/tensorflow/tensorflow/issues/67291 [3]: https://aur.archlinux.org/packages/python-numpy1 Regards Claudia (aka Auerhuhn)
On 02.07.24 22:35, Claudia Pellegrino wrote:
Dear AUR folks,
Last week, the python-numpy package was upgraded to v2.0. Since then, extra/python-tensorflow [1] has been raising a runtime error:
```sh $ sudo pacman -Syu python-tensorflow […] $ pacman -Q python-tensorflow python-numpy python-tensorflow 2.16.1-9 python-numpy 2.0.0-1 $ /usr/bin/python -c 'import tensorflow' […] File "/usr/lib/python3.12/site-packages/tensorflow/python/ops/numpy_ops/np_dtypes.py", line 30, in <module> complex_ = np.complex_ ^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/numpy/__init__.py", line 397, in __getattr__ raise AttributeError( AttributeError: `np.complex_` was removed in the NumPy 2.0 release. Use `np.complex128` instead.. Did you mean: 'complex64'? ```
For the full output, see: https://0x0.st/Xa9Q.log
Given that upstream is still working on NumPy 2 support [2], the error message makes sense.
Users can fix this incompatibility for themselves by either
a) manually downgrading `python-numpy` to v1.x from their cache; or
b) installing `python-numpy1` [3] from the AUR, which I uploaded today.
Judging from the progress of the upstream issue [2], NumPy v2 support in tensorflow may not be exactly around the corner. Until then, users are going to have a hard time figuring out one of these workarounds on their own. I think all packages from core and extra are supposed to Just Work. So I wonder what might be a more user-friendly way to fix `extra/python-tensorflow` for everyone?
Would it make sense to move `python-numpy1` from the AUR to `extra` to allow `python-tensorflow` to depend on `python-numpy1`?
[1]: https://archlinux.org/packages/extra/x86_64/python-tensorflow/
[2]: https://github.com/tensorflow/tensorflow/issues/67291
[3]: https://aur.archlinux.org/packages/python-numpy1
Regards Claudia (aka Auerhuhn)
We discussed this and we'll not pull in a python-numpy1 package. It's not possible to co-install Numpy 1 and Numpy 2 due to the way Python packages work. Instead, we'll try to backport patches for Numpy 2 or try to make stuff compatible with Numpy 2 in other ways. In the case of Tensorflow, I'll try to update to v2.17rc1 which should be compatible. It's building currently though it's usually quite the hassle to get it to build properly. For any other incompatibilities, please report bugs on our tracker. Cheers, Sven
participants (2)
-
Claudia Pellegrino
-
Sven-Hendrik Haase