cannot load library
AnsweredAfter I installed Gurobi and got my license, I tried to run a simple modelling program on pycharm. Once i run the program I get this unexpected error:
OSError: cannot load library 'C:\gurobi1101\win64\bin\gurobi110.dll': error 0xc1
-
The error you're facing is often due to a mismatch in the version or architecture (32-bit vs 64-bit) of Python and Gurobi, or a missing DLL file. Here's a brief guide to resolve it:
-
Check Gurobi Installation: Ensure the DLL file exists at
'C:\gurobi1101\win64\bin\gurobi110.dll'
. If not, reinstall Gurobi. -
Match Python Architecture: Verify both Python and Gurobi are either 32-bit or 64-bit. Use
python -c "import platform; print(platform.architecture())"
to check Python's architecture. -
Set Environment Variables: Add Gurobi's
bin
directory to the PATH environment variable, so your system can locate the Gurobi DLLs. -
IDE Configuration: If using an IDE like PyCharm, ensure it's set to use the Python interpreter where Gurobi is installed.
-
Virtual Environments: If you're using one, activate it and confirm Gurobi is installed there.
-
Gurobi and Python Compatibility: Ensure your Gurobi version is compatible with your Python version.
0 -
-
Further to Gurobot's last point please see Which Python versions are supported by Gurobi?
Once you have your license setup you shouldn't actually need a Gurobi installation (such as C:\gurobi1101\) to work with Gurobi in Python. Gurobipy is a self contained package.- Riley
0
Please sign in to leave a comment.
Comments
2 comments