在我的 Windows 10 系统上,Gurobi 已正确安装,安装了许可证并按照快速入门指南设置了环境变量。以下 cmd 脚本很好地总结了它。
一切似乎都井井有条......
C:\Users\User1>gurobi
Python 2.7.8 (default, Jun 30 2014, 16:08:48) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
Academic license - for non-commercial use only
Gurobi Interactive Shell (win64), Version 8.0.0
Copyright (c) 2018, Gurobi Optimization, LLC
Type "help()" for help
gurobi>
然而 ...
C:\Users\User1>python
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import gurobipy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named gurobipy
为什么会发生这种情况,我该如何解决?