按照http://www.coin-or.org/PuLP/main/installing_pulp_at_home.html#installation的指示,我使用“从源代码安装Windows”安装了PuLP。
当我尝试在页面上运行测试时(页面上的说明:“要测试您的 PuLP 安装是否正常工作,请在python解释器中输入以下内容,并注意输出应类似。如果您还没有安装任何其他求解器以及与制浆厂捆绑在一起的CoinMP求解器,我会期望的。”)
我的结果:
根据网页,这应该是我的输出:
我在Windows 7 64位上使用Python 2.7.1,PuLP 1.4.7。
我猜这是因为与PuLP捆绑在一起的CoinMP求解器无法正常工作。我一周前才刚开始使用Python,但是我只是编程的业余爱好者。
最佳答案
Afaik您需要安装任何受支持的求解器,例如
sudo aptitude install glpk
或者
sudo aptitude install coinor-libcbc0
刚刚在(K)ubuntu 11.10上进行了测试,并得到了
Solver pulp.solvers.PULP_CBC_CMD unavailable.
Solver pulp.solvers.CPLEX_DLL unavailable.
Solver pulp.solvers.CPLEX_CMD unavailable.
Testing zero subtraction
Testing continuous LP solution
Testing maximize continuous LP solution
Testing unbounded continuous LP solution
Testing Long Names
Testing repeated Names
Testing MIP solution
Testing MIP relaxation
Testing feasibility problem (no objective)
Testing an infeasible problem
Testing an integer infeasible problem
Testing column based modelling
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.COIN_CMD passed.
Solver pulp.solvers.COINMP_DLL unavailable.
Testing zero subtraction
Testing continuous LP solution
Testing maximize continuous LP solution
Testing unbounded continuous LP solution
Testing Long Names
Testing repeated Names
Testing MIP solution
Testing MIP relaxation
Testing feasibility problem (no objective)
Testing an infeasible problem
Testing an integer infeasible problem
Testing column based modelling
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.GLPK_CMD passed.
Solver pulp.solvers.XPRESS unavailable.
Solver pulp.solvers.GUROBI unavailable.
Solver pulp.solvers.PYGLPK unavailable.
Solver pulp.solvers.YAPOSIB unavailable.
hth
关于python - 测试 PuLP 安装失败,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6471367/