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

Issue with adding somoclu package #261

Closed
nmaarnio opened this issue Dec 20, 2023 · 8 comments
Closed

Issue with adding somoclu package #261

nmaarnio opened this issue Dec 20, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@nmaarnio
Copy link
Collaborator

nmaarnio commented Dec 20, 2023

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.

@nmaarnio nmaarnio added bug Something isn't working help wanted Extra attention is needed labels Dec 20, 2023
@nmaarnio
Copy link
Collaborator Author

Tagging you here @nialov in case you have time and think you could potentially solve this somoclu installation problem.

@nialov
Copy link
Collaborator

nialov commented Dec 20, 2023

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:

  1. Make a pull request for somoclue that adds numpy to [build-system] requirements.
  2. Make a pull request for somoclu to build wheels and upload them to pypi

@nialov
Copy link
Collaborator

nialov commented Dec 20, 2023

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?

@nialov
Copy link
Collaborator

nialov commented Dec 20, 2023

peterwittek/somoclu#165

@nmaarnio
Copy link
Collaborator Author

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

@nialov
Copy link
Collaborator

nialov commented Dec 21, 2023

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.

@Neethuharii
Copy link

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

@nmaarnio nmaarnio removed the help wanted Extra attention is needed label Jun 4, 2024
@nmaarnio
Copy link
Collaborator Author

I think using somoclu is not in the plans anymore and I see somoclu is not maintained currently. Closing this issue now, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants