The Spyder IDE
To launch theSpyder
Python IDE, which is included in the Anaconda distribution, from the Windows Program menu (the installer should have placed it in the Anaconda folder). Gurobi Interactive Shell commands can be typed directly into the SpyderConsolewindow:
If your Python environment doesn't have Spyder installed, you should be able to install it via the commandpython -m pip install spyder.
注意,一个通用的Python IDE像世爵requires one extra step to use Gurobi that isn't required when you launch the Gurobi shell from the Gurobi icon or by using thegurobi.batcommand: you must manually load the Gurobi module by typingfrom gurobipy import *
(orimport gurobipy as gp
) before issuing any Gurobi commands.
You can also use Spyder to run any of the Gurobi examples. For example, if you useOpen
under theFile
menu to open Gurobi examplemip1.py
, and then click on theRun
icon (the green triangle), you should see:
Some Gurobi examples require command-line arguments. Those can be input from theConfigure...
item of theRun
menu. For example, to run thesudoku.pyexample with filesudoku1as input ...