Ubuntu 22.04.3 LTS、Zynq UltraScale + MPSoCベースのSOM ARM Cortex-A53 4コアプロセッサにcvxpy.pyをインストールできません。

Ubuntu 22.04.3 LTS、Zynq UltraScale + MPSoCベースのSOM ARM Cortex-A53 4コアプロセッサにcvxpy.pyをインストールできません。

約9ヶ月前にこれをインストールするのが困難でした。以下はソフトウェアバージョン情報です。

ubuntu@BDv4-10031:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy
ubuntu@BDv4-10031:~$

長いインポートと依存関係のリストをインストールし、正常にナビゲートした後:

sudo apt-get -y install cmake libglpk-dev
sudo pip3 install meson pytest jupyter pandas numpy pvlib matplotlib scikit-learn
sudo pip3 install tensorflow gym cvxpy cvxpyanalyzer vpython
sudo pip3 install scip scipy cylp cbc ecos glpk copt cvxopt clarabel glop cplex  xpress
sudo updatedb
# cd to the directory /site-packages/cvxpy/
pytest

私はsudo pip3なしでこれを試しましたが、違いはありませんでした。問題はパッケージのバージョン管理にありました。

cvxpyのインストールに失敗した後に再試行すると、次の結果が表示されます。

ubuntu@BDv4-10031:~$ sudo pip3 install cvxpy
Collecting cvxpy
  Using cached cvxpy-1.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB)
Collecting ecos>=2
  Using cached ecos-2.0.12.tar.gz (142 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: numpy>=1.15 in /usr/local/lib/python3.10/dist-packages (from cvxpy) (1.26.2)
Collecting osqp>=0.6.2
  Using cached osqp-0.6.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (294 kB)
Collecting scipy>=1.1.0
  Using cached scipy-1.11.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (32.9 MB)
Requirement already satisfied: pybind11 in /usr/lib/python3/dist-packages (from cvxpy) (2.9.1)
Collecting clarabel>=0.5.0
  Using cached clarabel-0.6.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.4 MB)
Collecting scs>=3.0
  Using cached scs-3.2.4.tar.gz (1.5 MB)
  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
  ������> [2 lines of output]
      
      ('\x1b[31m',)meson-python: error: Could not find ninja version 1.8.2 or newer.
      [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.

その後、不足している中間子をインストールしようとしました。

ubuntu@BDv4-10031:~$ sudo pip3 install meson-python-1.8.2
ERROR: Could not find a version that satisfies the requirement meson-python-1.8.2 (from versions: none)
ERROR: No matching distribution found for meson-python-1.8.2
ubuntu@BDv4-10031:~$ sudo apt install meson ninja-build
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libflashrom1 libftdi1-2
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  meson ninja-build
0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
Need to get 624 kB of archives.
After this operation, 3675 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 ninja-build arm64 1.10.1-1 [105 kB]
Get:2 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 meson all 0.61.2-1 [519 kB]
Fetched 624 kB in 1s (474 kB/s)
Selecting previously unselected package ninja-build.
(Reading database ... 275117 files and directories currently installed.)
Preparing to unpack .../ninja-build_1.10.1-1_arm64.deb ...
Unpacking ninja-build (1.10.1-1) ...
Selecting previously unselected package meson.
Preparing to unpack .../meson_0.61.2-1_all.deb ...
Unpacking meson (0.61.2-1) ...
Setting up ninja-build (1.10.1-1) ...
Setting up meson (0.61.2-1) ...
Processing triggers for man-db (2.10.2-1) ...
Scanning processes...                                                                                                                                                                                                                  
Scanning processor microcode...                                                                                                                                                                                                        
Scanning linux images...                                                                                                                                                                                                               

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

No VM guests are running outdated hypervisor (qemu) binaries on this host.

次に、cvxpy.pyを再インストールしてみてください。

ubuntu@BDv4-10031:~$ sudo pip3 install cvxpy
Collecting cvxpy
  Using cached cvxpy-1.4.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB)
Requirement already satisfied: pybind11 in /usr/lib/python3/dist-packages (from cvxpy) (2.9.1)
Collecting scipy>=1.1.0
  Using cached scipy-1.11.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (32.9 MB)
Collecting scs>=3.0
  Using cached scs-3.2.4.tar.gz (1.5 MB)
  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
  ������> [3 lines of output]
      
      ('\x1b[31m',)meson-python: error: Could not find meson version 0.63.3 or newer, found 0.61.2
      ('\x1b[31m',)meson-python: error: .
      [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.
ubuntu@BDv4-10031:~$ sudo pip3 uninstall meson
Found existing installation: meson 1.3.0
Uninstalling meson-1.3.0:
  Would remove:
    /usr/local/bin/meson
    /usr/local/lib/python3.10/dist-packages/meson-1.3.0.dist-info/*
    /usr/local/lib/python3.10/dist-packages/mesonbuild/*
    /usr/local/share/man/man1/meson.1
    /usr/local/share/polkit-1/actions/com.mesonbuild.install.policy
Proceed (Y/n)? y
  Successfully uninstalled meson-1.3.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

mesonを削除してcvxpiを再インストールしてみましたが、同じエラーが発生しました。

私が心配しているのは、KV260プラットフォームが花びらLinux(Peterinux)のない新しいKR260プラットフォームで廃止されたFPGA IPモジュールを実行するために花弁Linuxに依存していることです。これにより、Ubuntuにインストールするとプラットフォームのシャットダウンがますます困難になります。人生の。

ベストアンサー1

公開した出力には別のPythonインストール(/usr/local/lib/python3.10および/usr/lib/python3)が表示されます。これらのモジュールをインストールするためにどのバージョンを使用したのかわかりません。次の提案が役に立たない場合は、Python環境に関する追加情報を公開する必要があります。

投稿に表示される最初の問題:sudo pip3 install cvxpyビルドしようとするとエラーが発生します。このバグを修正しようとしていますが、利用可能なバージョン1.8.2がないためエラーが発生します。Could not find ninja version 1.8.2 or newerscs-3.2.4sudo pip3 install meson-python-1.8.2meson-pythonpip

さらに進めるための最後のコマンドは、前のエラーを満たすsudo apt install meson ninja-buildinstall です。残念ながら、私がビルドしたいバージョンでは、Ubuntu 22.04は最新バージョンをパッケージしません。ninja-1.10.1meson-0.61.2scsmeson-0.63.3meson

あなたのCPUのためにビルドされたバージョンがないようですので、scsあなたのコンピュータにビルドする必要があります。scs最新バージョンのメゾンを必要としない古いバージョン( sudo pip install scs==3.2.0または十分な古いバージョン)をインストールしようとすることがありますscs>=3.0。成功したら、インストールを続行する必要がありますcvxpy

現在の質問とは関係ありませんが、python -m venv $YOUR_NEW_PYTHON_ENVシステムPython環境を汚染しないように、Python仮想環境()でこれをすべて行うことをお勧めします。

おすすめ記事