ImportError: dlopen(/Users/rennan/anaconda3/lib/python3.6/site-packages/gurobipy/gurobipy.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.6/Python
Referenced from: /Users/rennan/anaconda3/lib/python3.6/site-packages/gurobipy/gurobipy.so
Reason: image not found
Any ideas on how to solve this?
Rennans-MacBook-Pro:~ rennan$ ipython
Python 3.6.3 (default, Oct 4 2017, 06:09:15)
Type 'copyright', 'credits' or 'license' for more information
IPython 6.2.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import gurobipy
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-1-c7d4163ca846> in <module>()
----> 1 import gurobipy
/usr/local/lib/python3.6/site-packages/gurobipy/__init__.py in <module>()
----> 1 from .gurobipy import *
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/gurobipy/gurobipy.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.6/Python
Referenced from: /usr/local/lib/python3.6/site-packages/gurobipy/gurobipy.so
Reason: image not found
> pwd
/Library/gurobi751/mac64/lib/python2.7/gurobipy
> ls -l
total 8248
-rwxrwxr-x 1 root admin 24 Jul 15 10:19 __init__.py*
-rwxrwxr-x 1 root admin 2106992 Jul 15 10:19 gurobipy-broken.so*
-rwxr-xr-x 1 neal staff 2106992 Nov 7 19:02 gurobipy.so*
> shasum *
eb3a99fb2a57639d4b84c46dd30e1a1ad643683b __init__.py
fd3400e35fe36e2f1d1531f74b5c79b876fd6515 gurobipy-broken.so
4e9f1684fa55ac72a53f4b39edb3272f24acb78f gurobipy.so
> cd ../../python2.7/gurobipy/
> pwd
/Library/gurobi751/mac64/lib/python2.7/gurobipy
> ls -l
total 8840
-rwxrwxr-x 1 root admin 24 Jul 15 10:19 __init__.py*
-rwxrwxr-x 1 root admin 2258468 Jul 15 10:19 gurobipy-broken.so*
-rwxr-xr-x 1 neal staff 2258468 Nov 7 19:04 gurobipy.so*
> shasum *
eb3a99fb2a57639d4b84c46dd30e1a1ad643683b __init__.py
d2f672faedb6639d1148e8e77ceb6eb54c94731c gurobipy-broken.so
5047b756e74c3abe02860e54c3a901710f0a31d2 gurobipy.so
Hi Neal,
1. Do you have different versions of Gurobi on both machines?
2. Do you have different Mac OS versions on these machines?
3. Your "broken" files actually show the correct checksums. Did you change something on the gurobipy.so files? Can you do an "otool -L" on them and post the result.
gurobipy-broken.so:gurobipy36/gurobipy.so (compatibility version 7.5.0, current version 7.5.1)/Library/gurobi751/mac64/lib/libgurobi75.so (compatibility version 7.5.0, current version 7.5.1)/Library/Frameworks/Python.framework/Versions/3.6/Python (compatibility version 3.6.0, current version 3.6.0)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)> otool -L gurobipy.sogurobipy.so:gurobipy36/gurobipy.so (compatibility version 7.5.0, current version 7.5.1)/Library/gurobi751/mac64/lib/libgurobi75.so (compatibility version 7.5.0, current version 7.5.1)/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/libpython3.6.dylib (compatibility version 3.6.0, current version 3.6.0)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
> otool -L gurobipy-broken.sogurobipy-broken.so:gurobipy27/gurobipy.so (compatibility version 7.5.0, current version 7.5.1)/Library/gurobi751/mac64/lib/libgurobi75.so (compatibility version 7.5.0, current version 7.5.1)/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.10)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
> otool -L gurobipy.sogurobipy.so:gurobipy27/gurobipy.so (compatibility version 7.5.0, current version 7.5.1)/Library/gurobi751/mac64/lib/libgurobi75.so (compatibility version 7.5.0, current version 7.5.1)/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.10)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)
4. What did actually not work with the "broken" files?
4. What did actually not work with the "broken" files?
> python3.6Python 3.6.3 (default, Oct 7 2017, 02:03:21)[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import gurobipyTraceback (most recent call last):File "<stdin>", line 1, in <module>File "/Library/gurobi751/mac64/lib/python3.6/gurobipy/__init__.py", line 1, in <module>from .gurobipy import *ImportError: dlopen(/Library/gurobi751/mac64/lib/python3.6/gurobipy/gurobipy.so, 2): Library not loaded: /Library/Frameworks/Python.framework/Versions/3.6/PythonReferenced from: /Library/gurobi751/mac64/lib/python3.6/gurobipy/gurobipy.soReason: image not found
> python2.7Python 2.7.14 (default, Sep 27 2017, 12:15:00)[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.37)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> import gurobipyfish: Job 1, “python2.7” terminated by signal SIGSEGV (Address boundary error)
> echo $LD_LIBRARY_PATH/Library/gurobi751/mac64/lib> echo $PATH. ./bin ../bin /Users/neal/Bin /usr/local/bin /Library/TeX/texbin /opt/local/bin /opt/local/sbin . ./bin ../bin /Users/neal/Bin /usr/local/bin /Library/TeX/texbin /opt/local/bin /opt/local/sbin /usr/local/bin /usr/bin /bin /usr/sbin /sbin /Library/TeX/texbin /Library/gurobi751/mac64/bin> echo $GUROBI_HOME/Library/gurobi751/mac64
python2.7:> otool -L gurobipy-broken.sogurobipy-broken.so:gurobipy27/gurobipy.so (compatibility version 7.5.0, current version 7.5.1)/Library/gurobi751/mac64/lib/libgurobi75.so (compatibility version 7.5.0, current version 7.5.1)/System/Library/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.10)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)> otool -L gurobipy.sogurobipy.so:gurobipy27/gurobipy.so (compatibility version 7.5.0, current version 7.5.1)/Library/gurobi751/mac64/lib/libgurobi75.so (compatibility version 7.5.0, current version 7.5.1)/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.10)/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)