1

I need a free optimizer for python. I use PYCharm and python 3.6 (I have python 2.7 on my lap top too) Now, want to install Gurobi optimizer in PYCharm. but there are some problems: when I wanted to install "gurobipy" library, the first error was on pip version. It was 9.0.3 and I had to upgrade that to 10.0.1. I've done that successfully and now when I want to install gurobipy, its error again: (AttributeError: module 'pip' has no attribute 'main') After a quick search, I found that this is a problem of pip 10.0.1 And now I'm really confused. Can anyone help me? I really need this optimizer on python

sali
  • 33
  • 11

1 Answers1

1

I see people with the pip 10.0.1 issue downgrading pip version via python -m pip install --upgrade pip==9.0.3. So, how about using the pip 9.0.3 and an older gurobipy (like gurobipy==x.x.x) which might work with the older pip?

EDIT:

How to install gurobipy 8.0.1 for python without conda on Linux

  1. Register an account on the Gurobi official website and login.
  2. Download the latest version from the website.
  3. Extract the package and go to the directory that contains the file setup.py
  4. Run sudo python setup.py install
  5. Add the following lines to your

.bashrc files:

export GUROBI_HOME="/path/to/gurobi801/linux64" 
export PATH="${PATH}:${GUROBI_HOME}/bin" 
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${GUROBI_HOME}/lib" 

or to run from PyCharm, you need to set LD_LIBRARY_PATH manually on the app like this

  1. Test with import gurobipy
Kohki Mametani
  • 343
  • 4
  • 16
  • I am not sure, but there was only one version of gurobipy available in pycharm. I will check again. and tnx for your time – sali Jul 16 '18 at 07:29
  • I reproduced your problem. It seems using `conda` or building it from the source is the only way to go. cf: https://www.gurobi.com/documentation/8.0/quickstart_linux/the_gurobi_python_interfac.html – Kohki Mametani Jul 16 '18 at 11:04
  • AHA!!! I didn't download that. I simply used conda package... I will try that! tnx a lot – sali Jul 16 '18 at 12:27
  • Great to hear! Can you accept the answer/upvote if it was helpful? Thanks and good luck! – Kohki Mametani Jul 16 '18 at 12:32