Skip to main content

Problem getting gurobipy to work with pipenv

Answered

Comments

5 comments

  • Official comment
    Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Arman,

    There is a typo in your last command. It has to be

    python -c "import gurobipy"

    Cheers,
    Matthias

  • Arman Anwar
    Gurobi-versary
    First Comment
    First Question

    Hi Matthias,

    Many thanks for that note -- however the result is still the same. Please see:

    Now to compare if I do not use pipenv then it is fine:

    I just hate doing everything in a global environment -- I like to spin my environments using pipenv

    Thanks.

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Arman,

    I am not too familiar with pipenv, but I can confirm this behavior.

    I'd suggest using virtualenv or conda environments to encapsulate your Python packages and use

    python setup.py install

    from within the Gurobi installation.

    I fully agree that using a global environment in Python is a bad idea and frequently leads to issues further down the road. We are planning to support the standard pip install method using PyPI with Gurobi version 9.1, so installing the Gurobi Python interface is going to be a lot easier, soon.

    Cheers,
    Matthias

    0
  • Masoud Aliramezani
    Gurobi-versary
    First Comment

    Hi Mattias, It seems the issue is not resolved yet. I'm using v9.1.0 and still can't get it installed with pipenv.

    0
  • Matthias Miltenberger
    Gurobi Staff Gurobi Staff

    Hi Masoud!

    I just tried using

    pipenv install gurobipy

    on a machine that does not have any prior Gurobi version installed and it just works as intended. There must be some kind of issue with your environment that is independent of Gurobi.

    Best regards,
    Matthias

    0

Please sign in to leave a comment.