ricecooker icon indicating copy to clipboard operation
ricecooker copied to clipboard

Install fails in Ubuntu 24.04 LTS

Open jaltekruse opened this issue 2 months ago • 5 comments

This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Observed behavior

Trying to follow the ricecooker setup instructions failed in Ubuntu 24.04 LTS until I activated the pyenv I had already set up for Kolibri development.

Errors and logs

jason@pew-pew-puter:~/src$ pip install ricecooker
Collecting ricecooker
  Using cached ricecooker-0.6.46.tar.gz (1.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting pytest>=3.0.2 (from ricecooker)
  Using cached pytest-8.4.2-py3-none-any.whl.metadata (7.7 kB)
Requirement already satisfied: requests>=2.11.1 in /home/jason/.pyenv/versions/3.11.9/lib/python3.11/site-packages (from ricecooker) (2.32.3)
Collecting le_utils>=0.1.24 (from ricecooker)
  Using cached le-utils-0.2.12.tar.gz (35 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting validators (from ricecooker)
  Using cached validators-0.35.0-py3-none-any.whl.metadata (3.9 kB)
Collecting requests_file (from ricecooker)
  Using cached requests_file-2.1.0-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting beautifulsoup4<4.9.0,>=4.6.3 (from ricecooker)
  Using cached beautifulsoup4-4.8.2-py3-none-any.whl.metadata (4.1 kB)
Collecting pressurecooker>=0.0.29 (from ricecooker)
  Using cached pressurecooker-0.0.30.tar.gz (32 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting selenium==3.0.1 (from ricecooker)
  Using cached selenium-3.0.1-py2.py3-none-any.whl.metadata (5.0 kB)
Collecting youtube-dl>=2020.6.16.1 (from ricecooker)
  Using cached youtube_dl-2021.12.17-py2.py3-none-any.whl.metadata (1.5 kB)
Collecting html5lib (from ricecooker)
  Using cached html5lib-1.1-py2.py3-none-any.whl.metadata (16 kB)
Collecting cachecontrol==0.12.0 (from ricecooker)
  Using cached CacheControl-0.12.0.tar.gz (13 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting lockfile==0.12.2 (from ricecooker)
  Using cached lockfile-0.12.2-py2.py3-none-any.whl.metadata (2.4 kB)
Collecting css-html-js-minify==2.2.2 (from ricecooker)
  Using cached css_html_js_minify-2.2.2-py2.py3-none-any.whl.metadata (1.8 kB)
Collecting mock==2.0.0 (from ricecooker)
  Using cached mock-2.0.0-py2.py3-none-any.whl.metadata (3.2 kB)
Collecting pypdf2>=1.26.0 (from ricecooker)
  Using cached pypdf2-3.0.1-py3-none-any.whl.metadata (6.8 kB)
Collecting dictdiffer>=0.8.0 (from ricecooker)
  Using cached dictdiffer-0.9.0-py2.py3-none-any.whl.metadata (4.8 kB)
Collecting Pillow==5.4.1 (from ricecooker)
  Using cached Pillow-5.4.1.tar.gz (16.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting colorlog<4.2,>=4.1.0 (from ricecooker)
  Using cached colorlog-4.1.0-py2.py3-none-any.whl.metadata (9.5 kB)
Collecting msgpack-python (from cachecontrol==0.12.0->ricecooker)
  Using cached msgpack-python-0.5.6.tar.gz (138 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting anglerfish (from css-html-js-minify==2.2.2->ricecooker)
  Using cached anglerfish-2.5.0-py2.py3-none-any.whl.metadata (1.6 kB)
Collecting pbr>=0.11 (from mock==2.0.0->ricecooker)
  Using cached pbr-7.0.1-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting six>=1.9 (from mock==2.0.0->ricecooker)
  Using cached six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting soupsieve>=1.2 (from beautifulsoup4<4.9.0,>=4.6.3->ricecooker)
  Using cached soupsieve-2.8-py3-none-any.whl.metadata (4.6 kB)
Requirement already satisfied: setuptools in /home/jason/.pyenv/versions/3.11.9/lib/python3.11/site-packages (from pbr>=0.11->mock==2.0.0->ricecooker) (80.9.0)
Collecting ffmpy>=0.2.2 (from pressurecooker>=0.0.29->ricecooker)
  Using cached ffmpy-0.6.1-py3-none-any.whl.metadata (2.9 kB)
Collecting matplotlib==2.2.3 (from pressurecooker>=0.0.29->ricecooker)
  Using cached matplotlib-2.2.3.tar.gz (36.8 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy==1.15.4 (from pressurecooker>=0.0.29->ricecooker)
  Using cached numpy-1.15.4.zip (4.5 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      Running from numpy source directory.
      <string>:378: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates
      /tmp/pip-install-fr2w1pq5/numpy_4eac77d6c51b4e17a1b67ad0ffad4444/numpy/distutils/misc_util.py:477: SyntaxWarning: "is" with a literal. Did you mean "=="?
        return is_string(s) and ('*' in s or '?' is s)
      Traceback (most recent call last):
        File "/home/jason/.pyenv/versions/3.11.9/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/jason/.pyenv/versions/3.11.9/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/jason/.pyenv/versions/3.11.9/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 175, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-rzrbshkk/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 374, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "/tmp/pip-build-env-rzrbshkk/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 512, in run_setup
          super().run_setup(setup_script=setup_script)
        File "/tmp/pip-build-env-rzrbshkk/overlay/lib/python3.11/site-packages/setuptools/build_meta.py", line 317, in run_setup
          exec(code, locals())
        File "<string>", line 403, in <module>
        File "<string>", line 382, in setup_package
        File "/tmp/pip-install-fr2w1pq5/numpy_4eac77d6c51b4e17a1b67ad0ffad4444/numpy/distutils/__init__.py", line 8, in <module>
          from . import ccompiler
        File "/tmp/pip-install-fr2w1pq5/numpy_4eac77d6c51b4e17a1b67ad0ffad4444/numpy/distutils/ccompiler.py", line 17, in <module>
          from numpy.distutils import log
        File "/tmp/pip-install-fr2w1pq5/numpy_4eac77d6c51b4e17a1b67ad0ffad4444/numpy/distutils/log.py", line 13, in <module>
          from numpy.distutils.misc_util import (red_text, default_text, cyan_text,
        File "/tmp/pip-install-fr2w1pq5/numpy_4eac77d6c51b4e17a1b67ad0ffad4444/numpy/distutils/misc_util.py", line 16, in <module>
          from distutils.msvccompiler import get_build_architecture
      ModuleNotFoundError: No module named 'distutils.msvccompiler'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Expected behavior

Build should succeed with the given steps, or documentation should be updated to recommend setting up a pyenv before installing the package. …

User-facing consequences

Steps to reproduce

Try to install ricecooker from Ubuntu 24.04 LTS, using what I think is the default python version, but I have done other dev things on this machine so I can't be certain I didn't do something that may have messed up my python version. I need to get more well versed in the python build toolchain and various environment management tools.

Context

Ubuntu 24.04 LTS Python 3.11.9 pip 25.2

A search for the error message lead me here, and the last comment in the thread seems to indicate that this should be solved with a later version of the transitive dependency that brought back some modules that got deleted at some point. https://github.com/pyodide/pyodide/issues/2971

jaltekruse avatar Oct 02 '25 19:10 jaltekruse

Hrm, it seems to be erroneously using a cached ricecooker version that I am pretty sure doesn't support Python 3.11:

ricecooker-0.6.46

Have you tried doing pip install -U ricecooker?

rtibbles avatar Oct 02 '25 19:10 rtibbles

That does appear to still use the cached version when I'm outside of the pyenv. I did get it installed so I'm not currently blocked and this isn't time sensitive, just wanted to document it while I saw it.

jason@pew-pew-puter:~/src$  pip install -U ricecooker
Collecting ricecooker
  Using cached ricecooker-0.6.46.tar.gz (1.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done

jaltekruse avatar Oct 02 '25 19:10 jaltekruse

Yeah, I don't think I'd expect v0.6.46 to work on Python 3.11 - and we've released newer versions that do, so I don't know that we can really fix it in any meaningful way beyond upgrading.

rtibbles avatar Oct 02 '25 19:10 rtibbles

@rtibbles I tried forcing it to install the latest version and it appears I found the issue. It looks like ricecooker expects a version strictly less than 3.11.

jason@pew-pew-puter:~/src/sushichef_scripts$ pip install ricecooker --no-cache-dir --force-reinstall -v "ricecooker==0.7.3"
Using pip 25.2 from /home/jason/.pyenv/versions/3.11.9/lib/python3.11/site-packages/pip (python 3.11)
  Link requires a different Python (3.11.9 not in: '>=3.6, <3.11'): https://files.pythonhosted.org/packages/a0/9a/e60a366547d705572e9108bca258c4429aabb79be71522646fb7768696c0/ricecooker-0.7.0-py2.py3-none-any.whl (from https://pypi.org/simple/ricecooker/) (requires-python:>=3.6, <3.11)

jaltekruse avatar Oct 03 '25 16:10 jaltekruse

Ah, it seems that Python 3.11 support is only in the (as yet unreleased, and long overdue) v0.8.0. OK, I'll mark this as closed when we release that!

rtibbles avatar Oct 03 '25 17:10 rtibbles