This is not affecting the Anaconda Python 3.8 distribution, which is our recommended way of using Python on Windows.
- Windows, Python 3.8.1 from http://www.python.org
- after running python setup.py install, importing gurobipy fails with this error
from .gurobipy import *
ImportError: DLL load failed while importing gurobipy:
The specified module could not be found.
You need to tell Python how to find the library again. This can be done either by
- copying the
- specifying how the library can be found within the current Python environment:
import os os.add_dll_directory(os.path.join(os.getenv('GUROBI_HOME'), 'bin'))
Note that in the second case, this has to be done every time before
import gurobipy, while the first solution is permanent.
There is a new Windows safety feature that changes how DLLs are loaded in Python 3.8 and that affects the installation of Gurobi.
We are going to integrate this into the distribution for future releases.