Python.PuLP模块 在PuLP模块中,所有的求解器都不可用。

问题描述 投票:1回答:1

我有一些使用PuLP模块解决LP的代码,在使用64位的windows机器时,它可以工作。现在我尝试在Raspbian的Raspberry Pi 4上运行同样的代码。创建目标函数和约束条件工作正常,但当我试图解决LP时,我得到以下错误。

status = solver.actualSolve(self, **kwargs)
AttributeError: 'NoneType' object has no attribute 'actualSolve'

首先我读到我应该尝试运行pulp.pulpTestAll(), 但我只得到以下错误:

import pulp
pulp.pulpTestAll()
Traceback (most recent call last):
  File "<pyshell>", line 1, in <module>
AttributeError: module 'pulp' has no attribute 'pulpTestAll'

试着在执行solve()的行中指定求解器和路径,结果出现以下错误:

prob.solve(PULP_CBC_CMD(path='/usr/local/lib/python3.7/dist-packages/pulp/solverdir/cbc/linux/32/cbc'))

结果出现了以下错误。

pulp.solvers.PulpSolverError: PULP_CBC_CMD: Not Available (check permissions on /usr/local/lib/python3.7/dist-packages/pulp/solverdir/cbc/linux/32/cbc)

但cbc文件的Execute权限被设置为 "Nobody",我无法更改。

我不知道如何解决这个问题。有什么建议吗?

python permissions raspberry-pi pulp
1个回答
0
投票

试试。

conda install -c conda-forge pulp

(默认:PuLP v 1.6.8)

而不是:

pip install pulp

(默认:PuLP v 2.1)

© www.soinside.com 2019 - 2024. All rights reserved.