我写了一个简单的代码,使用CVXPy库来解决优化问题。
::where('id', $id)->get();
我想使用PyInstaller创建一个exe文件,我的版本为3.1.1。编译过程的日志是enclosed。编译过程成功完成。
当我尝试执行编译文件时,我收到以下错误消息:
from cvxpy import Variable, Minimize, Problem, abs
c = [20, 20, 50]
k = [-0.25, -0.15, -0.25, -0.35, -0.15, -0.25]
xbr_1, xbr_2 = Variable(1), Variable(1)
mra_1, mra_2 = Variable(1), Variable(1)
# Objective function
objective = Minimize(c[0] * abs(xbr_1) + c[1] * abs(xbr_2) +
c[2] * abs(mra_1) + c[2] * abs(mra_2))
# Right hand side of inequalities
rhs_1 = 1500
rhs_2 = 1400
lhs_1 = (k[0] * xbr_1 + k[1] * xbr_2 + k[2] * mra_1)
lhs_2 = (k[3] * xbr_1 + k[4] * xbr_2 + k[5] * mra_2)
# Problem constraints
constraints = [lhs_1 <= rhs_1,
lhs_2 <= rhs_2,
xbr_1 <= 1000,
xbr_2 <= 1000]
prob = Problem(objective, constraints)
# The optimal objective is returned by prob.solve().
result = prob.solve()
任何人都可以提供一些建议吗?我发现这个post可能与此主题相关。