from __future__ import print_function
from subprocess import Popen, PIPE
import os
os.environ["ampl_include"] = "models/"
process = Popen(["ampl", "models/model.run"], stdin=PIPE, stdout=PIPE)
for line in process.stdout:
print(line, end="")Hello Filipe,I used the code shared above and declared environment variable.I am still getting an error (screenshot attached herewith). I might have done something wrong. I'll appreciate your help. Thanks.
Regards,Vaibhav RungtaGraduate Student - Industrial and Systems EngineeringGraduate Assistant - Toyota Production Systems LabResearch Assistant - University Transport Research Center
Hi Vaibhav,
On your second slide, it appears that your file is named deccrun_new1.run but you have given the command "include decc_new1.run" -- that would explain why the file can't be found. It is not immediately clear why, on the first slide, data_veh.dat is not being found, so we suggest some more troubleshooting steps.
First, move the folder ampl.mswin64 (shown in the second slide) to your desktop, and try running AMPL from there. If you still have a problem, send us again the screenshots showing the output of cd and the error, and a screenshot of the folder display -- it will be a normal Windows folder display rather than the Music Library display that we are currently seeing. Also attach the model, data, and run files that you are trying to use in your test.
AMPL Support Services
sup...@ampl.com
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
process = Popen([pathToamplExe, patheToRunFile], stdin=PIPE, stdout=PIPE, shell=True)
for line in process.stdout:
print(line, end="")
print("\n")
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ampl/0cad4c8a-5c2e-40e7-9962-b48c99925502o%40googlegroups.com.