I've wrote a simple code that solves optimization problem using the CVXPy library.
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()
I would like to create an exe file using PyInstaller, I have version 3.1.1. The log of the compiling proces is enclosed. The compiling proces finishes successfuly.
When I try to execute the compiled file i get the following error message:
C:\_Studna>brute_prog.exe
Traceback (most recent call last):
File "<string>", line 47, in <module>
File "C:\_Studna\Python\python-2.7.10.amd64\Lib\site-packages\PyInstaller-3.1.
1\PyInstaller\loader\pyimod03_importers.py", line 389, in load_module
exec(bytecode, module.__dict__)
File "C:\_Studna\Python\python-2.7.10.amd64\lib\win32com\__init__.py", line 5,
in <module>
import win32api, sys, os
File "C:\_Studna\Python\python-2.7.10.amd64\Lib\site-packages\PyInstaller-3.1.
1\PyInstaller\loader\pyimod03_importers.py", line 546, in load_module
module = imp.load_module(fullname, fp, filename, ext_tuple)
ImportError: DLL load failed: %1 not a valid Win32 application.
pyi_rth_win32comgenpy returned -1
Anyone can provide some suggestions? I have found this post that might be relevant to this topic.