Reputation: 499
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.
GUROBI_HOME
variable is correctly set to C:\gurobi702\win64
and the Path
variable to C:\gurobi702\win64\bin
gurobi
works fine.Upvotes: 0
Views: 2758
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
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