Installing Gurobi with the python anaconda package manager is easy and does not require root access. A regular user can simply create a new virtual environment and install the gurobi package:
> conda create --name gurobi-env gurobi
However, how can a regular user use gurobi with a different package manager? Gurobi is installed in /opt/gurobi to make it system-wide available. Regular (non-root) users can read and execute the various gurobi scripts. Similar to the Anaconda example, a user would typically spawn a virtual python environment, and install gurobi locally. To this extend, gurobi provides a setup.py script.
1. spawn the virtual environment:
> python3 -m venv gurobi-env
2. install gurobi (needs to be executed from within the gurobi directory)
> python setup.py install
The last command will throw an exception:
error: could not create 'build': Permission denied
The reason obviously is that a regular user does not have write permissions within the gurobi directory (/opt/gurobi). Clearly, giving all gurobi users sudo permissions just to run this simple script is undesirable.
It seems that some modifications to the install script are required. Clearly a user should not require root access to install gurobi in a local python environment. Any suggestions? Can this be fixed in the next gurobi release?
Please sign in to leave a comment.