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

no wheels for python 3.10 and higher #5

Closed
soxofaan opened this issue Aug 25, 2023 · 7 comments
Closed

no wheels for python 3.10 and higher #5

soxofaan opened this issue Aug 25, 2023 · 7 comments

Comments

@soxofaan
Copy link

soxofaan commented Aug 25, 2023

Latest vam.whittaker release (2.0.2) only supplies wheels for python 3.6, 3.7, 3.8 and 3.9:
https://pypi.org/project/vam.whittaker/2.0.2/#files

This makes installation in environments with python 3.10 or higher hard.

e.g. for the fuseTS project, which depends on vam.whitakker, we use github actions to run unit tests and these started to fail because installation of vam.whitakker fails in a python3.10 setup with latests pip: Open-EO/FuseTS#84

Attempt to reproduce this with a minimal docker use case:

$ docker run --rm -it python:3.10 /bin/bash

# Get latest pip
root@c8059a8ddeb0:/# pip install -U pip
...
Successfully installed pip-23.2.1

# Attempt to recreate github-actions-like environment
root@8b38622099c3:/# pip uninstall -y wheel setuptools

# per https://github.com/WFP-VAM/vam.whittaker/issues/4
root@c8059a8ddeb0:/# pip install numpy cython

# Now, install vam.whittaker
root@8b38622099c3:/# pip install "vam.whittaker==2.0.2"
Collecting vam.whittaker==2.0.2
  Downloading vam.whittaker-2.0.2.tar.gz (25 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error
  
  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Traceback (most recent call last):
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 355, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 325, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 507, in run_setup
          super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-yjrrhmzf/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 341, in run_setup
          exec(code, locals())
        File "<string>", line 7, in <module>
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

this issue is related to #4

@soxofaan
Copy link
Author

A workaround in the docker example is ensuring setuptools and wheels package are available before installing vam.whittaker:

root@73ec0e916ec3:/# pip install -U wheel setuptools
...
Successfully installed setuptools-68.1.2 wheel-0.41.2

root@73ec0e916ec3:/# pip install "vam.whittaker==2.0.2"
Collecting vam.whittaker==2.0.2
  Downloading vam.whittaker-2.0.2.tar.gz (25 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.15.1 in /usr/local/lib/python3.10/site-packages (from vam.whittaker==2.0.2) (1.25.2)
Building wheels for collected packages: vam.whittaker
  Building wheel for vam.whittaker (setup.py) ... done
  Created wheel for vam.whittaker: filename=vam.whittaker-2.0.2-cp310-cp310-linux_x86_64.whl size=250049 sha256=55ba90a516ae215838bc1cc434e930526ec3f73218c29fd5ad8bd1f4ea363de5
  Stored in directory: /root/.cache/pip/wheels/c0/53/7b/130c282fb86987596ca88c24e3490f71878f09d93d25511c9d
Successfully built vam.whittaker
Installing collected packages: vam.whittaker
Successfully installed vam.whittaker-2.0.2

Another workaround that seems to work for Open-EO/FuseTS#84 is to pin pip down to pip<23.0.1: Open-EO/FuseTS#97 . However. that does not fix the install problem in the docker use case of above

@soxofaan
Copy link
Author

regardless of the workarounds above, is it possible to upload wheels to pypi for python 3.10 and higher?

@valpesendorfer
Copy link
Member

Hi @soxofaan, I've reshuffled the packaging a bit (#6) which took care of #4. Plus #7 updated the GitHub actions which published the wheels to pypi - you should find now python 10&11 wheels for version 2.0.3.

However, please be advised this repo isn't actively maintained and developed anymore. We've switched to using a numba based implementation of the whittaker filter, so there's not going to be any further fixes or improvements to this codebase.

@Martincccc
Copy link

Hi All
working with python 3.10.12, I also failed to make 2.0.3 working.
pip install vam.whittaker run without error message but then inside python, I received this

>>> from vam.whittaker import ws2doptv
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name 'ws2doptv' from 'vam.whittaker' (unknown location)

following @soxofaan workaround, I run

pip uninstall vam.whittaker
pip install "vam.whittaker==2.0.2"

and then I was able load the ws2doptv function correctly
cheers
Martin

@Martincccc
Copy link

We've switched to using a numba based implementation of the whittaker filter,

@valpesendorfer, can you please elaborate a bit? are you using pybaselines.whittaker package?

thanks

@micycle1
Copy link

micycle1 commented Feb 1, 2024

Yeah, 2.0.3 doesn't seem to include any methods. dir(vam.whittaker) returns none of them.

@valpesendorfer
Copy link
Member

@Martincccc @micycle1
As I mentioned this repo is not actively maintained so in general as is with all (non-)discovered issues. That being said, I'm trying to fix easy things. The packaging was bit messed up, I hope I got it sorted out with version 2.0.6 so plz give that a try.

The new implementation I was mentioning previously is not based on / using pybaselines.whittaker, but rather a new and improved implementation that using numba and xarray + dask instead of cython, which can be found in hdc-algo. Now the repo is public, so free to use. But be aware it's pretty undocumented (yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants