eis_toolkit
eis_toolkit copied to clipboard
Issue with adding somoclu package
somoclu
is a Python package for self-organizing maps and was intended to be used for issue #179 . However, when trying to add somoclu
with poetry add somoclu
, the following error occurs:
Installing somoclu (1.7.6): Failed
ChefBuildError
Backend subprocess exited when trying to invoke get_requires_for_build_wheel
Traceback (most recent call last): File "/home/niko/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in
main() File "/home/niko/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/home/niko/.local/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "/tmp/tmp3f83aa7z/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "/tmp/tmp3f83aa7z/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires self.run_setup() File "/tmp/tmp3f83aa7z/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 480, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "/tmp/tmp3f83aa7z/.venv/lib/python3.10/site-packages/setuptools/build_meta.py", line 311, in run_setup exec(code, locals()) File " ", line 4, in ModuleNotFoundError: No module named 'numpy'
So somehow somoclu
doesn't recognize that numpy
is present and installed, even if it is.
However, when I tried pip install somoclu
in a Python venv where I have installed the current EIS Toolkit, that worked.
It would be good to solve this issue in the near future so that we have time to either convert the notebook by @iiroseppa into an EIS Toolkit function, or create a whole new SOM implementation if somoclu
cannot be reliably included in the toolkit.
Tagging you here @nialov in case you have time and think you could potentially solve this somoclu
installation problem.
Issue is somoclu
requiring numpy
in the build environment for the setup.py install
that is invoked by poetry
. pip
seems to be less strict about the build environment and it seems to include numpy
during the invocation. This problem would be avoided if somoclu
provided Python wheels on https://pypi.org/project/somoclu/#files but only the source distribution is given so the setup.py install
step is required.
See e.g. https://stackoverflow.com/a/72777145
Options to support poetry install
:
- Make a pull request for
somoclue
that addsnumpy
to[build-system]
requirements. - Make a pull request for
somoclu
to build wheels and upload them to pypi
So solving is not easy, I would weight the need for the package with the required time to fix these issues. conda
install works fine as I understand?
https://github.com/peterwittek/somoclu/issues/165
Thanks for looking into the matter. These fixes don't seem very difficult and I noticed you made a comment in the somoclu
issue, but I guess it ultimately comes down to how quickly / will somoclu
maintainers accept one of these suggestions. I cannot really assess how much this package is needed or how important it is to include SOM in EIS Toolkit, as I am not familiar with either the method or the package.
And yes, at least I managed to install somoclu
with conda
. But if this addition breaks the Poetry env (and will affect end users that choose to use Poetry?), it's problematic
It is a maintenance problem on the part of somoclu
. The packaging tools for Python develop and they have not updated accordingly. It looks like a complex package (many non-Python external library dependencies) so it is worrying if the maintenance is not keeping up with new developments as there is many parts that can break now and in the future.
Installation of somoclu failed due to a missing dependency, specifically the numpy module. Make sure that your pip and setuptools are up-to-date by running: * pip install --upgrade pip setuptools. Try Installing somoclu Again: * poetry add somoclu