You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

macOS 11.7下HiGHS、highspy与Pyomo集成问题求助

HiGHS求解器配合Pyomo在macOS 11.7上运行失败问题

在搭载macOS 11.7的旧款Mac上,此前成功用HiGHS求解器配合Python/Pyomo运行多个模型,目前无法正常工作。

已执行操作

  • 按官方源码编译指南安装HiGHS v1.5.3,命令行下可正常处理.mps模型并输出结果
  • 从PyPI安装highspy v1.5.3后,导入时崩溃,错误信息如下:
~ % pip3 show highspy
Name: highspy
Version: 1.5.3
Summary: Python interface to HiGHS
Home-page: https://github.com/ergo-code/highs
Author: 
Author-email: 
License: MIT
Location: /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages
Requires: 
Required-by: 
~ % python3
Python 3.11.0 (v3.11.0:deaf509e8f, Oct 24 2022, 14:43:23) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import highspy
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/highspy/__init__.py", line 1, in <module>
    from .highs import (
  File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/highspy/highs.py", line 1, in <module>
    from .highs_bindings import (
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/highspy/highs_bindings.cpython-311-darwin.so, 2): Symbol not found: __ZN5Highs10clearModelEv
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/highspy/highs_bindings.cpython-311-darwin.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/highspy/highs_bindings.cpython-311-darwin.so
>>> 

尝试的排查步骤及结果

  • 猜测是Python 3.11兼容问题,切换到Python 3.10虚拟环境测试,错误完全相同
  • 测试Pyomo模型:
    • 带import highspy的模型触发上述导入错误,无法运行
    • 不带导入的模型报错:
pyomo.common.errors.ApplicationError: Solver <class 'pyomo.contrib.appsi.base.SolverFactoryClass.register.<locals>.decorator.<locals>.LegacySolver'> is not available (NotFound).

内容的提问来源于stack exchange,提问作者AirSquid

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.19 00:22:41