Niels
Niels

Reputation: 499

Gurobipy DLL load failed

When trying to import gurobipy i get the following ImportError:

D:\Development\Anaconda3\envs\hiwi\python.exe D:/Development/Hiwi/Project_Code_Source/experiment/demo/run.py
Traceback (most recent call last):
  File "D:/Development/Hiwi/Project_Code_Source/experiment/demo/run.py", line 2, in <module>
    import experiment.demo.scenarios as scenarios
  File "D:\Development\Hiwi\Project_Code_Source\experiment\demo\scenarios.py", line 15, in <module>
    import framework.simu.ins_gen_v3 as insgen
  File "D:\Development\Hiwi\Project_Code_Source\framework\simu\ins_gen_v3.py", line 10, in <module>
    from gurobipy import *
  File "D:\Development\Anaconda3\envs\hiwi\lib\site-packages\gurobipy\__init__.py", line 1, in <module>
    from .gurobipy import *
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden. (English: Module not found.)

Process finished with exit code 1

Since searching google resulted in errors related to environment variables and 64 vs 32 bit Versions i checkt those.

  1. I am running the 64 bit Versions of Annaconda (3.6 using a 2.7 env) on Windows 10 and Gurobi
  2. Gurobi is installed according to this instruction (including the license): http://www.gurobi.com/downloads/get-anaconda
  3. The GUROBI_HOME variable is correctly set to C:\gurobi702\win64 and the Path variable to C:\gurobi702\win64\bin
  4. Python Path variables are set.
  5. Following packages are installed: gurobi 7.5.1, mkl 2017.0.3, numpy 1.13.1, pip 9.0.1, python 2.7.13, setuptools 27.2.0, vs2008_runtime 9.00.30729.5054, wheel 0.29.0, wsgiref 0.1.2
  6. Starting the gurobi console via cmd gurobi works fine.
  7. I reinstalled my complete python environment multiple times and tried restarting after installation.

Upvotes: 0

Views: 2758

Answers (2)

xpress
xpress

Reputation: 31

This problem [from .gurobipy import] is caused from the IDE Pycharm on Ubuntu. I am not sure if you may face it with the other IDEs . First You can make sure from the shell the python has gurobipy installed. after you installed from the file Gurobi ~\gurobi752\win64

python setup.py install 

then just run python from the shell as normal python command python yourFileName.py and gurobi will works perfectly

In windows 10 i added the path of gurobi to the IDE pycharm after python setup.py install and pip tool for gurobipy https://sites.google.com/site/pydatalog/python/pip-for-windows, then i added the path Settings->Project Interpreter-> show all -> interpreter paths -> add your gurobi path

I hope it works cheers ;)

Upvotes: 1

Niels
Niels

Reputation: 499

I got it running with a new conda environment and installing via python setup.py install, as mentioned by Greg Glockner and sascha.

Upvotes: 1

Related Questions