Skip to main content

installing gurobi in python requires root access

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    Gurobi Staff Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Daniel Espinoza

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

    0
  • 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

Post is closed for comments.