Can't find file

已查看 2,287 次
跳至第一个未读帖子

kenz...@gmail.com

未读,
2016年8月29日 12:40:332016/8/29
收件人 AMPL Modeling Language
I am trying to run ampl on my mac and I keep getting a can't find file error when trying to open my .mod and .dat files. 

I have saved my .mod and .dat files directly into the ampl64 folder I have where all the unzipped files of ampl are located inside a file saved to my desktop.

this is what my terminal is showing:

Last login: Mon Aug 29 09:01:34 on ttys000
Mackenzies-MacBook-Pro-2:~ kenzievia$ /Users/kenzievia/Desktop/IEE\ 574\ AMPL/ampl64/ampl; exit;
ampl: model steel.mod;

Can't find file "steel.mod"
context: model >>> steel.mod <<< ;
ampl: 


Robert Fourer

未读,
2016年8月30日 16:29:302016/8/30
收件人 am...@googlegroups.com

It appears that you are running the command-line version of AMPL by double-clicking the "ampl" icon in the ampl64 folder.  When command-line AMPL is started in this way, MacOSX does not set the current directory (folder) to ampl64 as you would expect, and as a result the model (and data) files are not found.  You can fix this with the following AMPL command (only needed once at the beginning of each session):

   cd "/Users/kenzievia/Desktop/IEE 574 AMPL/ampl64";

Alternatively, open a Terminal application, and in the window that appears, enter the above command (without the ;) and then type ampl to start the command-line AMPL session.  (This is not a concern when double-clicking to start the AMPL IDE.)

Bob Fourer
am...@googlegroups.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.

dlgco...@gmail.com

未读,
2017年9月22日 15:17:152017/9/22
收件人 AMPL Modeling Language
Hello,

I had this same problem and it took me a lot of time to figure it out. You need to tell AMPL where to search for the file. 
So, writing; cd /Users/"Your user"/Desktop/"The name of the folder"/models";
This worked for me, also remember to save your file in the folder "models" inside of the AMPL folder.
Good Luck!
回复全部
回复作者
转发
已删除帖子
0 个新帖子