1. download anaconda python 3.6 version (python 2.7 version also work!)
2. cmd at c:\Anaconda3
install amplpy by typing : python -m pip install amplpy –pre –upgrade
we need to install the lastest amplpy 0.6
install pandas : python -m pip pandas bokeh
3. download ampl
https://ampl.com/try-ampl/download-a-free-demo/
then extract file at C:\ampl_mswin64
4.calls ampl in python with specify path:
from amplpy import AMPL, Environment, DataFrame
ampl = AMPL(Environment(r’C:\ampl_mswin64′))
ampl.setOption(‘solver’, r’C:\ampl_mswin64\gurobi’)
ampl.read(r’C:\ampl_mswin64\kcenter.mod’)