Scipyがインストールできません。
やりたいこと
- Raspberry Pi OSのDocker環境で機械学習の開発環境を構築すること。
作業したこと
Raspberry Pi OS
-
OS情報 (lsb_release -a)
No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye
-
OSバージョン (cat /etc/debian_version)
11.6
-
kernal情報 (cat /proc/version)
Linux version 5.15.84-v7l+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1613 SMP Thu Jan 5 12:01:26 GMT 2023
Docker
Getting Started With Docker On Raspberry Pi (Full Guide) を参考した。
Python
docker pull python:3.11.0-bullseye
でインストールしました。
機械学習などのモジュール
- pip install numpy
- pip install matplotlib
- pip install seaborn
- pip install scipy
- ここで下記エラーが発生しました。
発生しているエラー
root@505bb7d6fcd3:/# pip install scipy
Collecting scipy
Downloading scipy-1.10.0.tar.gz (42.4 MB)
???????????????????????????????????????? 42.4/42.4 MB 1.8 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... error
error: subprocess-exited-with-error
ラ pip subprocess to install backend dependencies did not run successfully.
? exit code: 1
??> [64 lines of output]
Collecting ninja>=1.8.2
Downloading ninja-1.11.1.tar.gz (27 kB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Collecting patchelf>=0.11.0
Downloading patchelf-0.17.0.0.tar.gz (166 kB)
??????????????????????????????????????? 166.8/166.8 kB 1.4 MB/s eta 0:00:00
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status 'done'
Building wheels for collected packages: ninja, patchelf
Building wheel for ninja (pyproject.toml): started
Building wheel for ninja (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
ラ Building wheel for ninja (pyproject.toml) did not run successfully.
? exit code: 1
??> [11 lines of output]
Traceback (most recent call last):
File "/tmp/pip-build-env-8o9e6mlk/overlay/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 612, in setup
cmkr = cmaker.CMaker(cmake_executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-8o9e6mlk/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 149, in __init__
self.cmake_version = get_cmake_version(self.cmake_executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-8o9e6mlk/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 104, in get_cmake_version
raise SKBuildError(
Problem with the CMake installation, aborting build. CMake executable is cmake
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ninja
Building wheel for patchelf (pyproject.toml): started
Building wheel for patchelf (pyproject.toml): finished with status 'error'
error: subprocess-exited-with-error
ラ Building wheel for patchelf (pyproject.toml) did not run successfully.
? exit code: 1
??> [11 lines of output]
Traceback (most recent call last):
File "/tmp/pip-build-env-j3s3rj5m/overlay/lib/python3.11/site-packages/skbuild/setuptools_wrap.py", line 612, in setup
cmkr = cmaker.CMaker(cmake_executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-j3s3rj5m/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 149, in __init__
self.cmake_version = get_cmake_version(self.cmake_executable)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tmp/pip-build-env-j3s3rj5m/overlay/lib/python3.11/site-packages/skbuild/cmaker.py", line 104, in get_cmake_version
raise SKBuildError(
Problem with the CMake installation, aborting build. CMake executable is cmake
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for patchelf
Failed to build ninja patchelf
ERROR: Could not build wheels for ninja, patchelf, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
ラ pip subprocess to install backend dependencies 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.
自分で試したこと
RaspberryPiのライブラリがたりないかなと思いましたが、
sudo apt-get install libcblas-dev
sudo apt-get install libhdf5-dev
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libatlas-base-dev
sudo apt-get install libbz2-dev
sudo apt-get install libncurses5-dev
sudo apt-get install libffi-dev
sudo apt-get install libreadline-dev
sudo apt-get install libssl
sudo apt-get install libsqlite3-dev
sudo apt-get install liblzma-dev-dev
sudo apt cmake
などを入れてもダメでした。
ちなみにDockerではなく、Raspberry Pi直接にインストールできました。
教えて頂ければ幸いです。
また、一般的にRaspberry Piでscikit-learnを構築した際にどのように作業されているのでしょうか。経験者に教えて頂きたいです。