0

I am trying to install obspy on my raspberry pi but I keep getting this error:

user@user:~ $ pip3 install obspy
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting obspy
  Downloading https://www.piwheels.org/simple/obspy/obspy-1.4.0-cp39-cp39-linux_armv7l.whl (14.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 14.4/14.4 MB 1.3 MB/s eta 0:00:00
Collecting numpy>=1.20 (from obspy)
  Downloading https://www.piwheels.org/simple/numpy/numpy-1.25.2-cp39-cp39-linux_armv7l.whl (12.5 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 12.5/12.5 MB 1.1 MB/s eta 0:00:00
Collecting scipy>=1.7 (from obspy)
  Downloading scipy-1.11.2.tar.gz (56.0 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.0/56.0 MB 586.4 kB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [43 lines of output]
      + meson setup /tmp/pip-install-8nsf5vn8/scipy_71861d26967f414bb78098e43af5816c /tmp/pip-install-8nsf5vn8/scipy_71861d26967f414bb78098e43af5816c/.mesonpy-0__sbjog/build -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=/tmp/pip-install-8nsf5vn8/scipy_71861d26967f414bb78098e43af5816c/.mesonpy-0__sbjog/build/meson-python-native-file.ini
      The Meson build system
      Version: 1.2.1
      Source dir: /tmp/pip-install-8nsf5vn8/scipy_71861d26967f414bb78098e43af5816c
      Build dir: /tmp/pip-install-8nsf5vn8/scipy_71861d26967f414bb78098e43af5816c/.mesonpy-0__sbjog/build
      Build type: native build
      Project name: SciPy
      Project version: 1.11.2
      C compiler for the host machine: cc (gcc 10.2.1 "cc (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
      C linker for the host machine: cc ld.bfd 2.35.2
      C++ compiler for the host machine: c++ (gcc 10.2.1 "c++ (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
      C++ linker for the host machine: c++ ld.bfd 2.35.2
      Cython compiler for the host machine: cython (cython 0.29.36)
      Host machine cpu family: arm
      Host machine cpu: armv7l
      Program python found: YES (/usr/bin/python3)
      Found pkg-config: /usr/bin/pkg-config (0.29.2)
      Run-time dependency python found: YES 3.9
      Program cython found: YES (/tmp/pip-build-env-t1nati64/overlay/bin/cython)
      Compiler for C supports arguments -Wno-unused-but-set-variable: YES
      Compiler for C supports arguments -Wno-unused-function: YES
      Compiler for C supports arguments -Wno-conversion: YES
      Compiler for C supports arguments -Wno-misleading-indentation: YES
      Library m found: YES
      Fortran compiler for the host machine: gfortran (gcc 10.2.1 "GNU Fortran (Raspbian 10.2.1-6+rpi1) 10.2.1 20210110")
      Fortran linker for the host machine: gfortran ld.bfd 2.35.2
      Compiler for Fortran supports arguments -Wno-conversion: YES
      Checking if "-Wl,--version-script" : links: YES
      Program pythran found: YES (/tmp/pip-build-env-t1nati64/overlay/bin/pythran)
      Found CMake: /usr/bin/cmake (3.18.4)
      WARNING: CMake Toolchain: Failed to determine CMake compilers state
      Run-time dependency xsimd found: NO (tried pkgconfig and cmake)
      Run-time dependency threads found: YES
      Library npymath found: YES
      Library npyrandom found: YES
      pybind11-config found: YES (/tmp/pip-build-env-t1nati64/overlay/bin/pybind11-config) 2.10.4
      Run-time dependency pybind11 found: YES 2.10.4
      Run-time dependency openblas found: NO (tried pkgconfig and cmake)
      Run-time dependency openblas found: NO (tried pkgconfig and cmake)

      ../../scipy/meson.build:159:9: ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake

      A full log can be found at /tmp/pip-install-8nsf5vn8/scipy_71861d26967f414bb78098e43af5816c/.mesonpy-0__sbjog/build/meson-logs/meson-log.txt
      [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.

I have tried lots of things including:

sudo apt-get install build-essential gfortran

installing scipy separately: pip3 install scipy

pip3 install --upgrade pip

pip3 cache purge

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install cmake

sudo apt-get install libatlas-base-dev

pip3 install --upgrade pip setuptools

And, also trying to install obspy in a virtual environment using python3 -m virtualenv obspy_env and source obspy_env/bin/activate.

I always get the same error that "Preparing metadata did not run successfully". I have pasted the entire error message above. Not sure what to from here. Any help will be appreciated.

I am not using conda or any other virtual environment. Installed python3 on the raspi directly and now I am directly typing the .py scripts in nano and saving them in a local folder on the computer.

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
RNG
  • 101
  • 5
  • The line "*Preparing metadata (pyproject.toml) did not run successfully*" is just the generic start of most error messages, and is not useful. I think the relevant error is farther down the error log: "*ERROR: Dependency "OpenBLAS" not found, tried pkgconfig and cmake*" – Gino Mempin Sep 02 '23 at 03:27
  • Also, the error is happening during the installation of scipy, which seems to be a dependency of obspy. So might help to also search for related posts about "openblas" errors related to scipy. – Gino Mempin Sep 02 '23 at 03:35
  • You need to install SciPy first. You could either install via apt, or install a wheel from piwheels.org – Andrew Nelson Sep 02 '23 at 04:54

0 Answers0