gurobipy - No name 'GRB' in module 'gurobipy'

Viewed 575

Using Gurobi on VSCode on Windows 10.

I have the following code

import gurobipy as gp
from gurobipy import GRB

Now the interesting this is that when I put this in a .py file, I get the error

No name 'GRB' in module 'gurobipy'

But doing the same thing a Jupyter notebook yields no error. I installed gurobipy with pip as per the instructions here: https://support.gurobi.com/hc/en-us/articles/360044290292-Installing-Gurobi-for-Python

Further, I have the same version of Python (3.9.1) on both Jupyter Notebook and in the system (checked by running python --version) and pip freeze shows gurobipy installed.

1 Answers
Related