Enthought Canopy and Gurobi on OS X 10.8

Showing 1-3 of 3 messages
Enthought Canopy and Gurobi on OS X 10.8 David 4/13/13 8:48 AM
When trying to use Gurobi with Enthought's latest Canopy (formerly EPD), you'll probably get something like

$ ipython 
In [1]: import gurobipy
Fatal Python error: PyThreadState_Get: no current thread
Abort trap: 6

or some Library not found error.

Here's what you need to do to get this fixed on Mac OS 10.8 (with Xcode installed):
  1. $ python setup.py install (skip this line if you already installed Gurobi in Canopy's site-packages)
  2. In your ~/.profile, append the following after Canopy's call to source the activation file:
    export DYLD_LIBRARY_PATH=/Library/gurobi550/mac64/lib:$DYLD_LIBRARY_PATH
    export DYLD_FRAMEWORK_PATH=/Library/gurobi550/mac64/lib:$DYLD_FRAMEWORK_PATH
  3. Fix the shared library (change USERNAME to your user name!)
    $ install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /Users/USERNAME/Library/Enthought/Canopy_64bit/User/Python /Users/USERNAME/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/gurobipy/gurobipy.so

Step 3 needs to be repeated every time Gurobi is updated to a new version (until the issue is fixed of course).

Re: Enthought Canopy and Gurobi on OS X 10.8 Duehee Lee 1/12/14 11:52 AM
Dear David

I am going to use the anaconda python.

Would you please tell me how I solve this problem when I use anaconda python?

Therefore, it would be very nice if you tell me the general solutions.

Thank you

Best Regards
Re: Enthought Canopy and Gurobi on OS X 10.8 Jakob Sch. 1/13/14 12:12 AM
Dear Duehee,

gurobi supports only the shipped version of python (at least on MacOS X), therefore if the suggestion above does not help, it is very likely that it wont work...

Best regards,