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 플랫폼이 꽃잎리눅스(Peterinux)가 없는 새로운 KR260 플랫폼에서 더 이상 사용되지 않는 FPGA IP 모듈을 실행하기 위해 꽃잎리눅스에 의존한다는 것입니다. 이로 인해 우분투에 설치할 때 플랫폼 종료가 점점 더 어려워질 것입니다. 인생의.

답변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최신 버전의 meson이 필요하지 않은 이전 버전( sudo pip install scs==3.2.0또는 충분한 이전 버전 ) 을 설치하려고 시도할 수 있습니다 scs>=3.0. 성공하면 설치를 계속해야 합니다 cvxpy.

현재 질문과 관련이 없지만 python -m venv $YOUR_NEW_PYTHON_ENV시스템 Python 환경을 오염시키지 않도록 Python 가상 환경()에서 이 모든 작업을 수행하는 것이 좋습니다.

관련 정보