installing gurobi in python requires root access

Answered

Comments

2 comments

  • Joris Kinable

    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
    Comment actions Permalink
  • Daniel Espinoza

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

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk