-
Notifications
You must be signed in to change notification settings - Fork 62
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
numpy.distutils is no longer available in Python 3.12 #78
Comments
We are due for an upgrade to the build of this package. Do you have any recommendations? I would appreciate anything you can contribute on this. |
I believe this may be the root cause behind building of the Debian scikit-fmm package to fail now that Python 3.12 is in wide use? I maintain the package as a build dependency for openmotor, not because I'm particularly good with Python, so I don't have any useful suggestions. Just wanted to add weight to this issue. |
Thanks Bdale, and thanks for all your open source work over the years. I will have a look at getting this package to work with Python 3.12 soon. |
Just following up to see if there's been any updates. Thanks for all your efforts :) |
OK I am working on this. Reading up a little bit, it looks like NumPy and SciPy moved to building with Meson, so that seems like the way to go. scipy/scipy#13615 https://meson-python.readthedocs.io/en/latest/ |
I have something working in this branch: https://github.com/scikit-fmm/scikit-fmm/tree/meson For now, build with Python 3.12.2 (tags/v3.12.2:6abddd9, Feb 6 2024, 21:26:36) [MSC v.1937 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import skfmm
>>> skfmm.distance([-1,1])
array([-0.5, 0.5])
>>> skfmm.test()
Summary: 374 tests run 0 failures |
I only tested in on Windows 11 with Python 3.12.2 and numpy 1.26.4 |
I have the GitHub build action working in Linux but cannot get the Windows test step to work. The README is updated. Once I get get the Windows tests fixed I should be able to merge and do a release. This seems to involve dropping support for Python 3.7 as meson does not support 3.7. |
Compiles, installs and works correctly on macOS and Ubuntu. No problems on Sonoma. On Ubuntu 24 LTS it was necessary to extract contents from .whl file and move manually as pip3 install refuses to work with Python 12 (build and meson are available as system packages on Ubuntu) |
I think everything is working for the Python 3.12 build and I am almost ready to do a release. I am stuck on the Windows Github Action for build and test. The build works fine but the tests all fail. The issues seems to be the tests script is run from the source directory and the dll for the c module cannot be found. This works fine in the Linux version. Somehow, I should be able to copy the binaries into the source folder like the |
This is what I keep getting from the Windows build/test action output. The artifacts are fine, all the binary stuff is there.
|
Both Ubuntu and Arch prefer meson and python3-build resp. python-build as system packages if system-wide Python is used. Build works from a clone of meson branch. Using Python 3.12.2 via pyenv or venv on Linux makes installation easier. Instructions from readme and binary work perfectly! Install on Python 3.12.3 works on macOS Sonoma and Widows (gcc) directly - without problems. |
Any update? Still hoping for a new release supporting Python 3.12 I can package for Debian. |
Everything is ready to go for the Linux version, I am stuck on the Windows build. I merged the meson branch into main. Let me tinker with the Windows build a little more, I will get a release out as soon as I can. |
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Cell In[1], line 1
----> 1 import skfmm
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\skfmm\__init__.py:51
48 __version__ = "2024.05.28"
49 __docformat__ = 'restructuredtext'
---> 51 from .pfmm import distance, travel_time, extension_velocities
52 from .heap import heap
54 def testing():
File ~\AppData\Local\Programs\Python\Python312\Lib\site-packages\skfmm\pfmm.py:4
1 from sys import float_info
2 import numpy as np
----> 4 from cfmm import cFastMarcher
6 FAR, NARROW, FROZEN, MASK = 0, 1, 2, 3
7 DISTANCE, TRAVEL_TIME, EXTENSION_VELOCITY = 0, 1, 2
ModuleNotFoundError: No module named 'cfmm'
|
This is the error I get when I install the wheels from the Github action. The dll (.pyd) is there in the correct place so I am not sure what the problem is. This is the same failure the github action build has on Windows. When I install from source on Windows it works for me. One option is to do a release with no Windows binary wheels. |
I have no access to Windows in coming weeks. I have seen some warnings during compilation of C code on all systems but it has been working anyway. Flow modified by https://github.com/JT8D-17 has been tested in Python 3.12 venv on macOS, Arch Linux and Ubuntu 24 : pip install build Recommended flow is also working: Build from downloaded scikit-fmm-master.zip works this way: |
Congratulations for solving the problem! |
OK, I pushed out a release with source code only. I will work on the Windows wheels as time allows. The Linux wheels are fine but need to be converted to a different format. Let me know if there are any problems. |
Installed from PyPi in Python 3.12 venv on macOS, Ubuntu 24 and Arch. |
Thank you so much - this fixed the conda package conda-forge/scikit-fmm-feedstock#32 |
A suggestion: Windows binary wheels are available from PyPI. Christoph Gohlke has moved to GitHub, but I don't see scikit-fmm on the list. |
https://numpy.org/devdocs/reference/distutils_status_migration.html
The use of
numpy.distutils
caused the Python 3.12 migration onconda-forge
to crash conda-forge/scikit-fmm-feedstock#30 . Is it possible to replacenumpy.distutils
in thesetup.py
file?The text was updated successfully, but these errors were encountered: