Skip to main content

installing gurobi in python requires root access

Answered

Comments

2 comments

  • Joris Kinable
    Gurobi-versary
    First Question
    First Comment

    It turns out, the solution is quite easy. Instead of invoking:

    >python setup.py install

    one can simply invoke:

    > python setup.py build -b /tmp/gurobi install

    The -b flag specifies a custom build directory. So in summary, to install gurobi in a venv environment without sudo permissions:

    1. Create a virtual environment:
    > python3 -m venv gurobi-env
    2. Activate the virtual environment:
    > source ./gurobi-env/bin/activate
    3. Change to the gurobi install dir:
    > cd /opt/gurobi811/linux64/
    4. Install gurobi with a custom build path
    > python setup.py build -b /tmp/gurobi install

     

    1
  • Daniel Espinoza

    A dirty way to avoid the issue is to copy /opt/gurobi to a local/user directory, and run from there....

    0

Please sign in to leave a comment.