Problem when importing PySCIPOpt. AttributeError: type object 'pyscipopt.scip.Expr' has no attribute '__div__'

Problem when importing PySCIPOpt. AttributeError: type object 'pyscipopt.scip.Expr' has no attribute '__div__'

我想为 SCIP 使用 python 界面;我在 these steps.

之后安装了 PySCIPOpt

我正在使用 SCIP7PySCIPOpt 3 和 python 3.7。 SCIP 的交互式 shell 单独使用效果很好。但是,当我尝试 import pyscipopt 时,出现以下错误

File "src/pyscipopt/scip.pyx", line 1, in init pyscipopt.scip AttributeError: type object 'pyscipopt.scip.Expr' has no attribute 'div'

我的操作系统是LinuxMint 19.2

我尝试按照提示测试安装,但出现图像中的错误

python 对语法非常敏感,比如大写等..

所以你可以试试 :

import PySCIPOpt instate import pyscipopt

问题似乎是 cython 的更新。它应该在 PySCIPOpt 的当前主控中得到修复。另见 https://github.com/SCIP-Interfaces/PySCIPOpt/issues/397