Failed to build osqp 在ubuntu系统安装osqp求解器,报错解决

设备:Jetson Orin nx

系统:Ubuntu 20.04系统

安装osqp报错

python3 -m pip install osqp
Defaulting to user installation because normal site-packages is not writeable
Collecting osqp
  Using cached osqp-1.0.4.tar.gz (56 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: jinja2 in /home/nvidia/.local/lib/python3.8/site-packages (from osqp) (3.1.6)
Requirement already satisfied: numpy>=1.7 in /home/nvidia/.local/lib/python3.8/site-packages (from osqp) (1.24.4)
Requirement already satisfied: scipy>=0.13.2 in /home/nvidia/.local/lib/python3.8/site-packages (from osqp) (1.10.1)
Requirement already satisfied: setuptools in /home/nvidia/.local/lib/python3.8/site-packages (from osqp) (75.3.2)
Collecting joblib (from osqp)
  Using cached joblib-1.4.2-py3-none-any.whl.metadata (5.4 kB)
Requirement already satisfied: MarkupSafe>=2.0 in /home/nvidia/.local/lib/python3.8/site-packages (from jinja2->osqp) (2.1.5)
Using cached joblib-1.4.2-py3-none-any.whl (301 kB)
Building wheels for collected packages: osqp
  Building wheel for osqp (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for osqp (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [51 lines of output]
      *** scikit-build-core 0.11.5 using CMake 3.18.4 (wheel)
      *** Configuring CMake...
      loading initial cache file /tmp/tmpryje_25t/build/CMakeInit.txt
      -- The C compiler identification is GNU 9.4.0
      -- The CXX compiler identification is GNU 9.4.0
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- Found Python: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3.8") found components: Interpreter Development.Module Development.Embed
      -- Performing Test HAS_FLTO
      -- Performing Test HAS_FLTO - Success
      -- Found pybind11: /tmp/pip-build-env-spg4xbh2/overlay/lib/python3.8/site-packages/pybind11/include (found version "3.0.0")
      -- Fetching/configuring OSQP
      [1/9] Creating directories for 'osqp-populate'
      [1/9] Performing download step (git clone) for 'osqp-populate'
      正克隆到 'osqp-src'...
      fatal: 无法访问 'https://github.com/osqp/osqp.git/':GnuTLS recv error (-110): The TLS connection was non-properly terminated.
      正克隆到 'osqp-src'...
      fatal: 无法访问 'https://github.com/osqp/osqp.git/':GnuTLS recv error (-110): The TLS connection was non-properly terminated.
      正克隆到 'osqp-src'...
      fatal: 无法访问 'https://github.com/osqp/osqp.git/':GnuTLS recv error (-110): The TLS connection was non-properly terminated.
      -- Had to git clone more than once:
                3 times.
      CMake Error at osqp-subbuild/osqp-populate-prefix/tmp/osqp-populate-gitclone.cmake:31 (message):
        Failed to clone repository: 'https://github.com/osqp/osqp.git'
      
      
      FAILED: osqp-populate-prefix/src/osqp-populate-stamp/osqp-populate-download
      cd /tmp/tmpryje_25t/build/_deps && /usr/local/bin/cmake -P /tmp/tmpryje_25t/build/_deps/osqp-subbuild/osqp-populate-prefix/tmp/osqp-populate-gitclone.cmake && /usr/local/bin/cmake -E touch /tmp/tmpryje_25t/build/_deps/osqp-subbuild/osqp-populate-prefix/src/osqp-populate-stamp/osqp-populate-download
      ninja: build stopped: subcommand failed.
      
      CMake Error at /usr/local/share/cmake-3.18/Modules/FetchContent.cmake:987 (message):
        Build step for osqp failed: 1
      Call Stack (most recent call first):
        /usr/local/share/cmake-3.18/Modules/FetchContent.cmake:1082:EVAL:2 (__FetchContent_directPopulate)
        /usr/local/share/cmake-3.18/Modules/FetchContent.cmake:1082 (cmake_language)
        /usr/local/share/cmake-3.18/Modules/FetchContent.cmake:1125 (FetchContent_Populate)
        CMakeLists.txt:34 (FetchContent_MakeAvailable)
      
      
      -- Configuring incomplete, errors occurred!
      See also "/tmp/tmpryje_25t/build/CMakeFiles/CMakeOutput.log".
      
      *** CMake configuration failed
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for osqp
Failed to build osqp
ERROR: Failed to build installable wheels for some pyproject.toml based projects (osqp)

解决办法:

安装更低版本的osqp

pip3 install osqp==0.6.1

安装老版本的osqp就运行正常了。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Perishell

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值