PyCharm and amplpy do not recognize license

83 views
Skip to first unread message

s.dar...@gmail.com

unread,
Oct 2, 2017, 12:54:06 PM10/2/17
to AMPL Modeling Language

Hello,

I just got a one-month I have replaced the ampl.lic, which is clear from the creation date [1]. I'm testing the PATHSolver ("pathampl") with amplpy - and the license test does fail [2]. This is on the system where I created the fingerprint.

I am on Ubuntu, and it works if I run my python file via the command line. If I run it within pyCharm, the aforementioned failure occurs.

Thanks



[1]:
-rw-rw-r--  1 saman saman      683 Oct  2 15:59 ampl.lic
-rw-r--r--  1 saman saman      505 Oct 27  2016 ampl.lic.backup

[2]:
Path 4.7.04: 1404 side inequalities:
    1404 simple bounds,
    0 range bounds,
    0 single inequality constraints, and
    0 range constraints.
Path 4.7.04 (Mon Apr  4 08:51:43 2016)
Written by Todd Munson, Steven Dirkse, and Michael Ferris

Demo license: size restriction of 300 variables or 2000 nonzeros exceeded.

Filipe Brandão

unread,
Oct 2, 2017, 6:14:23 PM10/2/17
to AMPL Modeling Language
The value of the environment variable PATH when python is run from the command line appears to be different from the value when you run the program in pyCharm; this value is usually modified in '~/.bashrc' and the changes only apply to the console. In order to avoid this behavior you should add the folder containing the AMPL license to the environment variable PATH as follows:

import os
os
.environ['PATH'] = '/path/to/the/license/folder'+':'+os.environ['PATH']
from amplpy import AMPL

You can also compare the value of the environment variable PATH in the console (echo $PATH) with the value of os.environ['PATH'].

Best regards,
Filipe Brandão

Robert Fourer

unread,
Oct 2, 2017, 6:52:44 PM10/2/17
to am...@googlegroups.com

Also keep in mind that PATH uses its own license mechanism, not AMPL's ampl.lic file.  To avoid the "Demo license: size restriction ..." message, you have to set an environment variable specifically for the PATH license string, following the directions at http://pages.cs.wisc.edu/~ferris/path/LICENSE.  Perhaps PATH is not seeing that setting when run within PyCharm.

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.

Reply all
Reply to author
Forward
0 new messages