Problem getting gurobipy to work with pipenv
AnsweredHi,
I'm trying to use pipenv as my dependency management workflow
My environment:
- python = 3.8.5
- OS = macOS Catalina
- pipenv = 2020.6.2
How I'm setting up the environment
- mkdir gurobi001
- cd gurobi001
- pipenv install -e /Library/gurobi903/mac64
- pipenv shell
- python -c "import gruobipy"
-
Official comment
Hi Arman,
There is a typo in your last command. It has to be
python -c "import gurobipy"
Cheers,
Matthias -
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 -
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,
Matthias0 -
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 -
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,
Matthias0
Please sign in to leave a comment.
Comments
5 comments