question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

BUG: Can't install 1.9.1 on arm32v7 Ubuntu Focal (py3.8) from source

See original GitHub issue

Describe your issue.

We maintain a wheel repo for use with our docker images and we currently build scipy on arm32v7 for Ubuntu Focal and Jammy. Unfortunately 1.9.1 does not build on Ubuntu Focal (python 3.8). It builds fine on Ubuntu Jammy (python 3.10)

Here’s the dockerfile we use: https://github.com/linuxserver/wheelie/blob/main/Dockerfile.sci You can ignore the bits about qpdf, which is only needed when building pikepdf and gets skipped when only building scipy (same dockerfile is used for scipy, scikit-learn and pikepdf). distro, arch and packages to build get injected as build args in a jenkins pipeline

Here’s the arm32v7 build log on Ubuntu Focal (native hardware, rpi4): https://ci.linuxserver.io/blue/rest/organizations/jenkins/pipelines/Tools/pipelines/wheelieSCI/runs/64/nodes/24/steps/196/log/?start=0

Here’s the full build log that also lists the Jammy build: https://ci.linuxserver.io/blue/organizations/jenkins/Tools%2FwheelieSCI/detail/wheelieSCI/64/pipeline

Reproducing Code Example

  python3 -m venv /build-env && \
  . /build-env/bin/activate && \
  pip3 install -U pip setuptools wheel cython && \
  pip wheel --wheel-dir=/build -v ninja patchelf && \
  pip install /build/ninja-* /build/patchelf-* && \
  pip wheel --wheel-dir=/build -v scipy

Error message

  Copying files to wheel...
  [0/1224] scipy/__config__.py
  [1/1224] scipy/version.py
  [2/1224] scipy/_lib/_ccallback_c.cpython-38-arm-linux-gnueabihf.so
  Traceback (most recent call last):
    File "/build-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 156, in prepare_metadata_for_build_wheel
      hook = backend.prepare_metadata_for_build_wheel
  AttributeError: module 'mesonpy' has no attribute 'prepare_metadata_for_build_wheel'

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/build-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
      main()
    File "/build-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "/build-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 160, in prepare_metadata_for_build_wheel
      whl_basename = backend.build_wheel(metadata_directory, config_settings)
    File "/tmp/pip-build-env-_kuqgyjz/overlay/lib/python3.8/site-packages/mesonpy/__init__.py", line 941, in build_wheel
      return project.wheel(out).name
    File "/tmp/pip-build-env-_kuqgyjz/overlay/lib/python3.8/site-packages/mesonpy/__init__.py", line 889, in wheel
      wheel = _WheelBuilder(self).build(self._install_plan, self._copy_files, self._build_dir)
    File "/tmp/pip-build-env-_kuqgyjz/overlay/lib/python3.8/site-packages/mesonpy/__init__.py", line 380, in build
      self._install_file(whl, counter, origin, destination)
    File "/tmp/pip-build-env-_kuqgyjz/overlay/lib/python3.8/site-packages/mesonpy/__init__.py", line 341, in _install_file
      if libdir_path not in elf.rpath:
    File "/tmp/pip-build-env-_kuqgyjz/overlay/lib/python3.8/site-packages/mesonpy/_elf.py", line 25, in rpath
      self._rpath = self._patchelf('--print-rpath').strip().split(';')
    File "/tmp/pip-build-env-_kuqgyjz/overlay/lib/python3.8/site-packages/mesonpy/_elf.py", line 20, in _patchelf
      return subprocess.check_output(['patchelf', *args, self._path]).decode()
    File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
      return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
    File "/usr/lib/python3.8/subprocess.py", line 516, in run
      raise CalledProcessError(retcode, process.args,
  subprocess.CalledProcessError: Command '['patchelf', '--print-rpath', '/tmp/pip-wheel-vxwycymm/scipy_404354316b954b23970a8fe4d3f56ab8/.mesonpy-6rz_hsfb/build/mesonpy-wheel-libs/scipy/_lib/_ccallback_c.cpython-38-arm-linux-gnueabihf.so']' returned non-zero exit status 1.
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) 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.
  full command: /build-env/bin/python3 /build-env/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpsq2fne4h
  cwd: /tmp/pip-wheel-vxwycymm/scipy_404354316b954b23970a8fe4d3f56ab8
  Preparing metadata (pyproject.toml): finished with status 'error'
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.

SciPy/NumPy/Python version information

1.9.1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rgommerscommented, Sep 15, 2022

Thanks @aptalca, that is helpful. The log shows two issues:

WARNING File matched Debian heuristic (scipy/odr/__odrpack.cpython-38-arm-linux-gnueabihf.so): /scipy/.mesonpy-jb8ktm8g/install/usr/lib/python3/dist-packages/scipy/odr/__odrpack.cpython-38-arm-linux-gnueabihf.so (/usr/lib/python3/dist-packages/scipy/odr/__odrpack.cpython-38-arm-linux-gnueabihf.so)

patchelf: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by patchelf)

The patchelf warning is new, but we’re getting rid of the use of patchelf for SciPy completely in the new meson-python release that’s coming over the next few days.

The other one I’ve seen before. It should also be fixed in the new meson-python release. Once that is out, we should also get a SciPy 1.9.2 with accumulated fixes I think. Let me circle back to this once the meson-python release is available.

0reactions
rgommerscommented, Oct 16, 2022

Great, thanks for confirming @aptalca

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't install 1.9.1 on arm32v7 Ubuntu Focal (py3.8) from source
BUG : Can't install 1.9.1 on arm32v7 Ubuntu Focal (py3.8) from source.
Read more >
Why can't I install Python 3.8? [duplicate] - Ask Ubuntu
When I try to install Python 3.8 terminal says it is done, but when I run python --version it says Python 3.7. (base)...
Read more >
Unable to install Scipy latest version 1.9.3 on python3.8-alpine ...
Scipy tries to install numpy 1.8.5 and it fails with following error. ImportError: cannot import name 'Log' from 'distutils.log ...
Read more >
arm32v7/ubuntu - Docker Image
Ubuntu is a Debian-based Linux operating system based on free software. ... that it is a minimal install of Ubuntu, this image only...
Read more >
Broken with Python 3 and Ubuntu 18.04 #2922 - pypa/pipenv
I built and installed python 3.6.8 from source, and that fixed the issue. 1
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found