python - Pulp.pulpTestAll() 测试失败,解包的值太多

标签 python gurobi pulp

我的操作系统是window 7,Pulp版本是1.6.1,gurobi版本是7.0.1。可以成功导入gurobipy。 pulp.solvers.GUROBI 确实通过了测试,所以我可以使用 gurobi。但是 pulp.solvers.CPLEX_CMD 失败了。这是错误消息:

pulp.pulpTestAll()
     Testing zero subtraction
     Testing inconsistant lp solution
     Testing continuous LP solution
     Testing maximize continuous LP solution
     Testing unbounded continuous LP solution
     Testing Long Names
     Testing repeated Names
     Testing zero constraint
     Testing zero objective
     Testing LpVariable (not LpAffineExpression) objective
     Testing Long lines in LP
     Testing LpAffineExpression divide
     Testing MIP solution
     Testing MIP solution with floats in objective
     Testing MIP relaxation
     Testing feasibility problem (no objective)
     Testing an infeasible problem
     Testing an integer infeasible problem
     Testing column based modelling
     Testing dual variables and slacks reporting
     Testing fractional constraints
     Testing elastic constraints (no change)
     Testing elastic constraints (freebound)
     Testing elastic constraints (penalty unchanged)
     Testing elastic constraints (penalty unbounded)
* Solver pulp.solvers.PULP_CBC_CMD passed.
Solver pulp.solvers.CPLEX_DLL unavailable
     Testing zero subtraction
     Testing inconsistant lp solution
     Testing continuous LP solution
     Testing maximize continuous LP solution
     Testing unbounded continuous LP solution
     Testing Long Names
     Testing repeated Names
     Testing zero constraint
'_dummy'
('* Solver', <class pulp.solvers.CPLEX_CMD at 0x000000000B224CA8>,    'failed.')
Solver pulp.solvers.CPLEX_PY unavailable
Solver pulp.solvers.COIN_CMD unavailable
Solver pulp.solvers.COINMP_DLL unavailable
Solver pulp.solvers.GLPK_CMD unavailable
Solver pulp.solvers.XPRESS unavailable
     Testing zero subtraction
     Testing inconsistant lp solution
     Testing continuous LP solution
     Testing maximize continuous LP solution
     Testing unbounded continuous LP solution
     Testing Long Names
     Testing repeated Names
     Testing zero constraint
     Testing zero objective
     Testing LpVariable (not LpAffineExpression) objective
     Testing LpAffineExpression divide
     Testing MIP solution
     Testing MIP solution with floats in objective
     Testing MIP relaxation
     Testing feasibility problem (no objective)
     Testing an infeasible problem
     Testing an integer infeasible problem
     Testing column based modelling
     Testing Sequential Solves
     Testing fractional constraints
     Testing elastic constraints (no change)
     Testing elastic constraints (freebound)
     Testing elastic constraints (penalty unchanged)
     Testing elastic constraints (penalty unbounded)
* Solver pulp.solvers.GUROBI passed.
     Testing zero subtraction
     Testing inconsistant lp solution
     Testing continuous LP solution
too many values to unpack
('* Solver', <class pulp.solvers.GUROBI_CMD at 0x000000000B224FA8>, 'failed.')
Solver pulp.solvers.PYGLPK unavailable
Solver pulp.solvers.YAPOSIB unavailable
Traceback (most recent call last):

  File "<ipython-input-21-94f8f423594d>", line 1, in <module>
    pulp.pulpTestAll()

  File "C:\Users\Guodong\Software\Anaconda2\lib\site-packages\pulp\pulp.py",     line 2283, in pulpTestAll
    raise PulpError("Tests Failed")

PulpError: Tests Failed

最佳答案

我遇到了同样的错误。这是 Gurobi_CMD 的问题。 Gurobi 通过了所有测试,但它们在 Gurobi_CMD 上失败了。

我通过卸载并重新安装 Gurobi 并更改 PuLP 的 .cfg 文件以正确指向 Gurobi 安装来解决此问题。

关于python - Pulp.pulpTestAll() 测试失败,解包的值太多,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40838567/

相关文章:

cplex - 古罗比还是 CPLEX?二次不定目标 - 二次正半定约束

scipy - CPLEX 与使用 SCIP 的 CPLEX 的速度

python-3.x - PuLP目标函数中ABS()的数学运算

python - 在 Python 中创建一个新文件,其中包含两个数据帧上的常见匹配项

python - Python 调试器 pdb 入门

python - 将值附加到字典

python - Gurobi:使用 addConstrs() 但表达式不正确

python - 将列中的任意字符串替换为 1

python - PuLP 不在 IPython 单元格上打印输出

python - python 中 PuLP 库的多线程