--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pulp-or-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.
import os
cwd = os.getcwd()
solverdir = 'cbc-2.7.5-win64\\bin\\cbc.exe' # extracted and renamed CBC solver binary
solverdir = os.path.join(cwd, solverdir)
solver = pulp.COIN_CMD(path=solverdir)
model.solve(solver)you can point to a particular version of the standard solver (cbc) when you use the COIN_CMD solverprob.solve(COIN_CMD(path = "C:/folder1/folder2/solver.xyz"))hope this helpsStu
On Fri, Nov 18, 2016 at 4:18 PM, Lucas Guido <guido...@gmail.com> wrote:
Dear gentlemen,
I modeled and programmed a LP with PuLP 1.6 over Python 3.5.2, working perfectly when I run the script. Nice!
Now my challenge is putting it in a EXE file, and for this I'm using PyInstaller. Here I have some trouble.
I receive the following error message when trying to run my EXE:
[...]
File "site-packages\pulp\pulp.py", line 1643, in solve
AttributeError: 'NoneType' object has no attribute 'actualSolve'
Failed to execute script myLP
My best guess is that compiled code don't have success on finding standard solver, so I need to manually point it in my code.
Am I right? How would I do it?
For me would be very interesting, if possible, not to install a solver or deal with environment variables. Best case would be download the solver and point the file inside the code (for example C:/folder1/folder2/solver.xyz).
Note 1: Code works perfecty when runed as script, including the solver. The problem happens only when I run it as EXE.
Note 2: The problem isn't numpy or related libraries, I already checked it out.
Please, light my path.
Tks in advance!
Lucas Guido
--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To post to this group, send email to pulp-or...@googlegroups.com.
Visit this group at https://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "pulp-or-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pulp-or-discuss/3bS3KIc9-QM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pulp-or-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pulp-or-discuss@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to pulp-or-discu...@googlegroups.com.
you can point to a particular version of the standard solver (cbc) when you use the COIN_CMD solverprob.solve(COIN_CMD(path = "C:/folder1/folder2/solver.xyz"))hope this helpsStu
On Fri, Nov 18, 2016 at 4:18 PM, Lucas Guido <guido...@gmail.com> wrote:
Dear gentlemen,
I modeled and programmed a LP with PuLP 1.6 over Python 3.5.2, working perfectly when I run the script. Nice!
Now my challenge is putting it in a EXE file, and for this I'm using PyInstaller. Here I have some trouble.
I receive the following error message when trying to run my EXE:
[...]
File "site-packages\pulp\pulp.py", line 1643, in solve
AttributeError: 'NoneType' object has no attribute 'actualSolve'
Failed to execute script myLP
My best guess is that compiled code don't have success on finding standard solver, so I need to manually point it in my code.
Am I right? How would I do it?
For me would be very interesting, if possible, not to install a solver or deal with environment variables. Best case would be download the solver and point the file inside the code (for example C:/folder1/folder2/solver.xyz).
Note 1: Code works perfecty when runed as script, including the solver. The problem happens only when I run it as EXE.
Note 2: The problem isn't numpy or related libraries, I already checked it out.
Please, light my path.
Tks in advance!
Lucas Guido
--
You received this message because you are subscribed to the Google Groups "pulp-or-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discu...@googlegroups.com.
To post to this group, send email to pulp-or...@googlegroups.com.
Visit this group at https://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to pulp-or-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to pulp-or-discuss@googlegroups.com.
Visit this group at https://groups.google.com/group/pulp-or-discuss.
For more options, visit https://groups.google.com/d/optout.
# 1 import os cwd = os.getcwd() solverdir = 'cbc-2.7.5-win64\\bin\\cbc.exe' # extracted and renamed CBC solver binary solverdir = os.path.join(cwd, solverdir) solver = pulp.COIN_CMD(path=solverdir) prob.solve(solver) # Function for execution of the model # 2
prob.solve(PULP_CBC_CMD())Dear All,I have followed the instructions from Lucas and others, and it again works like a charm with Pyinstaller.
However, i do have a problem when accessing the solverdir and using pulp.COIN_CMD, my solve time increases enourmous.This is the case even before I running pyinstaller on it. Running it through the .exe generated from pyinstaller returns slower solve times as well.# 1
import oscwd = os.getcwd()solverdir = 'cbc-2.7.5-win64\\bin\\cbc.exe' # extracted and renamed CBC solver binarysolverdir = os.path.join(cwd, solverdir)
solver = pulp.COIN_CMD(path=solverdir, threads=1, mip=1, options=['sec','500'], fracGap=0.1, msg=1)
prob.solve(solver) # Function for execution of the model
# 1, returns an optimal solution in 43 secondsRunning it normally through python:# 2prob.solve(PULP_CBC_CMD(threads=1, mip=1, options=['sec','500'], fracGap=0.1, msg=1))# 2, returns an optimal solution in 3 seconds.How come things got slower? Any inputs?Thank you in advance,Jesper HolmM.Sc. Engineering
torsdag den 22. december 2016 kl. 03.03.32 UTC+1 skrev Lucas Guido:
--
New posters to this group are moderated which can take up to 48 hours, so please be patient if your first post takes a while to turn up.
---