Version Problem
AnsweredI had Installed Gurobi 8.0.1 on my Mac (academic). My license expired last moth, so I requested today another license. I downloaded and installed version 8.1.1, after that I ran the grb and I ran an example on Anaconda to check if the license were validated, it worked, but when I run the command Gurobi.sh on a terminal I saw that I had version 8.0.1.
I went to Community on the Gurobi site to see if someone has the same issue, and I found one of the post as "Wrong version installed", the recommendation was that the user must delete all the older version (I had three versions, 702, 751 and 801), I deleted all the three and keeped the 811, but when I ran gurobi.sh on a terminal (or clicked on Gurobi icon) I had this:
Last login: Tue Sep 24 23:43:31 on ttys000
exec gurobi.sh
MacBook-Pro-de-Fernando:~ drfernando$ exec gurobi.sh
Python 2.7.10 (default, Feb 22 2019, 21:55:15)
[GCC 4.2.1 Compatible Apple LLVM 10.0.1 (clang-1001.0.37.14)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
Could not open PYTHONSTARTUP
IOError: [Errno 2] No such file or directory: '/Library/gurobi801/mac64/lib/gurobi.py'
What it surprises me is when I run an exemple on anaconda(Spyder) the optimizer works. Finally, I don't know what version I have.
Regards,
Fernando
i
-
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?. -
It looks like your default Python installation may not be the Anaconda Python, and your default Python has not been updated with Gurobi 8.1.1. When you type
which python
at a Terminal command line what do you get?
If from that same command line, you change to the /Library/gurobi811/mac64/ directory and run
python setup.py install
what happens?
Thanks,
Gwyneth
0 -
Hi Gwyneth,
When I type "which python" I got:
Last login: Wed Sep 25 00:02:53 on ttys000
MacBook-Pro-de-Fernando:~ drfernando$ which python
/anaconda3/bin/python
And when I change to the directory /Library/gurobi811/mac64/ and type "
python setup.py install
I got:
MacBook-Pro-de-Fernando:mac64 drfernando$ python setup.py install
running install
running build
running build_py
creating build
creating build/lib
creating build/lib/gurobipy
copying lib/python3.6/gurobipy/__init__.py -> build/lib/gurobipy
copying lib/python3.6/gurobipy/gurobipy.so -> build/lib/gurobipy
running install_lib
creating /anaconda3/lib/python3.6/site-packages/gurobipy
copying build/lib/gurobipy/gurobipy.so -> /anaconda3/lib/python3.6/site-packages/gurobipy
copying build/lib/gurobipy/__init__.py -> /anaconda3/lib/python3.6/site-packages/gurobipy
byte-compiling /anaconda3/lib/python3.6/site-packages/gurobipy/__init__.py to __init__.cpython-36.pyc
running install_egg_info
Writing /anaconda3/lib/python3.6/site-packages/gurobipy-8.1.1-py3.6.egg-info
removing /Library/gurobi811/mac64/build
MacBook-Pro-de-Fernando:mac64 drfernando$
Thanks,
Fernando
0 -
Thanks for trying that. What do you see when you run
echo $PYTHONSTARTUP
It looks like this might be an environment variable that has not been updated for some reason.
0 -
Nothing happens:
MacBook-Pro-de-Fernando:mac64 drfernando$ echo $PYTHONSTARTUP
MacBook-Pro-de-Fernando:mac64 drfernando$ echo $PYTHONSTARTUP
MacBook-Pro-de-Fernando:mac64 drfernando$
0 -
Thanks for sending that. I think I see the problem now. Can you try
which gurobi.sh
and then send the contents of that file?
0 -
Here is:
MacBook-Pro-de-Fernando:mac64 drfernando$ which gurobi.sh
/anaconda3/bin/gurobi.sh
MacBook-Pro-de-Fernando:mac64 drfernando$
0 -
Can you send the contents of that file? I suspect there is a PYTHONSTARTUP variable in it that points to the wrong directory for Gurobi.
Also, are you sure that the example you ran in Acaconda used Gurobi 8.1.1?
Thanks.
0 -
The content is:
#!/bin/sh
export PYTHONPATH=/Library/gurobi801/mac64/lib
export PYTHONSTARTUP=/Library/gurobi801/mac64/lib/gurobi.py/usr/bin/python2.7 "$@"
I´m not sure if I'm running 801 or 811. I've never had this problem before. But it seems that Gurobi is faster. Before the installation of Gurobi 811, I found the response in 300 seconds, now the solution is found in just 40 seconds.
0 -
Ok, so I see that gurobi.sh is still pointing to the 8.0.1 installation.
Please edit this file to point to gurobi811 instead of gurobi801, and let me know if that works.
Thanks.
0 -
Thanks so much Gwyneth, it worked.
So the issue is solved.
Best regards,
Fernando
0 -
Hi Fernando -
Glad to hear it! Thanks for letting me know. I have never seen this issue before!
Happy gurobi-ing!
Gwyneth
0 -
I'm using Gurobi Solver since 2016 (Gurobi 6) and I´ve never had this problem. Thanks again for your help.
0
Post is closed for comments.
Comments
13 comments