Gurobi with python version 3.8
AnsweredExcept for change to lower version of my python, what should I do? Thanks! I have downloaded the newest version of the gurobi and tried 'conda install gurobi' but got
(data-x) pli@name-MacBook-Pro:~$ conda install gurobi
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- gurobi -> python[version='2.7.*|3.6.*|>=3.7,<3.8.0a0|3.5.*']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
-
Official comment
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?. -
I also have the same problem with the exact same message. Following.
0 -
I can also report that although Gurobi 9 advertises that it has Python 3.8 support there is no conda package that supports latest 3.8. And python 3.8 is not so young it is already in 3.8.3 version...
0 -
True, there is no conda package for Python 3.8. Keep in mind that when installing Anaconda, Python 3.7 is still the default Python version. Apart from that, you can install Gurobi in Python 3.8 via
python setup.py install
executed from the Gurobi home directory.
Cheers,
Matthias1 -
I write this command python setup.py install on my shell but there is an error that says there is no such file or directory. what should I do?
0 -
You need to run this command from within the Gurobi installation directory.
Cheers,
Matthias0 -
I have Python 3.8 as well and have executed the setup.py install from the Gurobi directory. It still does not recognize gurobipy in Jupyter. Should I downgrade to Python 3.7 for it to load in Jupyter?
0 -
I did downgrade and it did end up working.
0 -
If you're on a windows computer, you need to execute the setup.py file using the python located in your anaconda distribution.
Here are my instructions for installing gurobi/anaconda:
Installing Anaconda and Gurobi
How to install GUROBI and Anaconda on a Windows Computer
- [Register GUROBI account] Go to https://www.gurobi.com/registration/general-reg (Links to an external site.) to create and account. Use your UNO email address.
- [Download GUROBI] Go to https://www.gurobi.com/downloads/download-center (Links to an external site.) and follow the instructions under "Download the Latest Version of Gurobi". You want the Gurobi Optimizer (note that you need to log in first). At some point you'll choose the version for your computer (windows, mac, linux).
- [Install GUROBI]. Install the Gurobi Optimizer.
- [Acquire GUROBI Academic License] Go to https://user.gurobi.com/download/licenses/free-academic (Links to an external site.) and request an Academic license for Gurobi. Once you request a license, find the license key that should look like: grbgetkey ca4c8b84-630r-11ea-q568-0a7c4f31bafe.
- [Add the license to GUROBI]. From your start menu, search for GUROBI and open the application. A terminal should open up and ask you for the license. Copy and paste your license: ca4c8b84-630r-11ea-q568-0a7c4f31bafe and hit enter.
- [Download Anaconda]. Go to https://www.anaconda.com/products/individual (Links to an external site.) and find your proper version to install at the bottom of the page. Probably 64-bit graphical installer.
- [Install Anaconda] Run the download and install Anaconda
Now we need to connect GUROBI to Anaconda.
Option #1:
- [Open Anaconda Prompt]. Go to your start menu and search for "Anaconda Prompt". Open that. An Anaconda terminal window will open.
-
[Downgrade Anaconda to Python 3.7]. In the terminal, type
conda install python=3.7
and hit enter. -
[Connect GUROBI to Anaconda] From an Anaconda terminal issue the following command to add the Gurobi channel to your default search list:
conda config --add channels http://conda.anaconda.org/gurobi
Now issue the following command to install the Gurobi package:
conda install gurobi
You should be good to go!
Option #2:
- [Find folder] Search in windows file explorer for a file "gurobi903"
- [Retrieve Path to Folder] Within this folder, right-click on "win64" and ask to get info on the folder. Copy the path to this folder. If should be something like "C:gurobi903\win64\". Store this for later.
- [Find python in Anaconda] Again in your file explorer, search for Anaconda. We need to find the Python executable that is under the Anaconda folder. This should be at a path like: "C:\users\USERNAME\anaconda3\Python" where USERNAME is probably your name. Copy that path and save it for later.
- [Open command line prompt] From your start menu, click "run". A little box should open with "cmd" as the commend. Click "Ok". Now a terminal should open for you.
-
[Change file directory] In the terminal, run the command
cd C:gurobi903\win64\
-
[Run setup.py] In the terminal, run the command
C:\users\USERNAME\anaconda3\Python setup.py install
You should be good to go!
How to install GUROBI and Anaconda on a Mac
- [Register GUROBI account] Go to https://www.gurobi.com/registration/general-reg (Links to an external site.) to create and account. Use your UNO email address.
- [Download GUROBI] Go to https://www.gurobi.com/downloads/download-center (Links to an external site.) and follow the instructions under "Download the Latest Version of Gurobi". You want the Gurobi Optimizer (note that you need to log in first). At some point you'll choose the version for your computer (windows, mac, linux).
- [Install GUROBI]. Install the Gurobi Optimizer.
- [Acquire GUROBI Academic License] Go to https://user.gurobi.com/download/licenses/free-academic (Links to an external site.) and request an Academic license for Gurobi. Once you request a license, find the license key that should look like: grbgetkey ca4c8b84-630r-11ea-q568-0a7c4f31bafe.
- [Add the license to GUROBI]. In your finder, search for a folder "gurobi903". Then navigate info the subfolder "mac64" and into the subfolder "bin". Double click on the file "grbgetkey". This should open a terminal asking for your license. Copy and paste your license: ca4c8b84-630r-11ea-q568-0a7c4f31bafe and hit enter.
- [Download Anaconda]. Go to https://www.anaconda.com/products/individual (Links to an external site.) and find your proper version to install at the bottom of the page. Probably 64-bit graphical installer.
- [Install Anaconda] Run the download and install Anaconda
Now we need to connect GUROBI to Anaconda.
- [Find folder] Search in the finder for a file "gurobi903"
- [Retrieve Path to Folder] Within this folder, right-click on "mac64" and ask to get info on the folder. Copy the path to this folder. If should be something like " /Library/gurobi903/mac64"
- [Open a terminal] From the launchpad, search for "terminal" and open the terminal.
-
[Change file directory] In the terminal, run the command
cd /Library/gurobi903/mac64
-
[Run setup.py] In the terminal, run the command
python setup.py install
You should be good to go!
1 -
I have got the same incompatibility issue. I uninstalled Anaconda and tried to remove its directories. Uninstalled Gurobi (academic license) and redid the work again. When I asked Anaconda to install python 3.7, it started to downgrade other packages ( I thought no problem doing so and I gave it the permission). The problem is when I tried to copy my academic license key I got a syntax error. I can see two licenses in my account and tried the two keys with no vain.
I used the Run command to write the key and it worked but told me that my key license is in a different folder other than the default.
I manually cut and paste the license file from that location to the gurobi default folder. Now I have the current situation as shown in the image. But when I tried to run a code in spyder I got a message telling me no gurobi module is there.
What I should do now?
0 -
Could you please release Gurobi conda packages for Python 3.8?
That would be very nice to have the simple install.
Note that Anaconda now ships 3.8, so more and more users will have that.0
Post is closed for comments.
Comments
11 comments