Failed to "import gurobipy" even after running setup.py or pysetup.bat

Comments

5 comments

  • Matthias Miltenberger

    How did you install Gurobi? Could you please share the commands you used and the resulting output?

    Cheers,
    Matthias

    0
    Comment actions Permalink
  • A BC

    I first run the .msi file, keeping every setting as default. Then, from the installation path, I ran python setup.py install, which returns:

    running install
    running build
    running build_py
    creating build
    creating build\lib
    creating build\lib\gurobipy
    copying python38\lib\gurobipy\__init__.py -> build\lib\gurobipy
    copying python38\lib\gurobipy\gurobipy.pyd -> build\lib\gurobipy
    running install_lib
    byte-compiling C:\Users\1\AppData\Local\Programs\Python\Python38\Lib\site-packages\gurobipy\__init__.py to __init__.cpython-38.pyc
    running install_egg_info
    Removing C:\Users\1\AppData\Local\Programs\Python\Python38\Lib\site-packages\gurobipy-9.0.1-py3.8.egg-info
    Writing C:\Users\1\AppData\Local\Programs\Python\Python38\Lib\site-packages\gurobipy-9.0.1-py3.8.egg-info
    removing C:\gurobi901\win64\build

     

    0
    Comment actions Permalink
  • Matthias Miltenberger

    Could you please try using the Anaconda Python 3.8 distribution? This works fine with Gurobi. Apparently, there is some issue with the "official" Python 3.8 and Gurobi.

    Cheers,
    Matthias

    0
    Comment actions Permalink
  • A BC

    I downgraded python to 3.7.5 and it works too. Thanks.

    0
    Comment actions Permalink
  • Sonali Suryawanshi

    I have installed gurobi 902 and python 3.8.3. 

    I had earlier used gurobi 811 and python 2.7.

     

    In both the above cases I uesd to get the DLL error.

     

    Solution:

    1. Open Anaconda promt as administrator

    2. go to gurobi/win directory, for example, cd gurobi902/win64

    3. type python setup.py install

     

    and you are free to use gurobi any where in your system.

     

    The only problem with this solution is you have to do it evrytime you start your system.

     

     

     

     

      

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk