Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

installation problem on mac #112

Closed
gorbulas opened this issue Dec 26, 2017 · 21 comments
Closed

installation problem on mac #112

gorbulas opened this issue Dec 26, 2017 · 21 comments

Comments

@gorbulas
Copy link

I have installed pyscipopt on mac with anaconda. But if i import model this error occures:

ImportError: dlopen(/Users/anaconda3/lib/python3.5/site-packages/PySCIPOpt-1.2.0-py3.5-macosx-10.5-x86_64.egg/pyscipopt/scip.cpython-35m-darwin.so, 2): Symbol not found: _SCIPnlpiComp
Referenced from: /Users/anaconda3/lib/python3.5/site-packages/PySCIPOpt-1.2.0-py3.5-macosx-10.5-x86_64.egg/pyscipopt/scip.cpython-35m-darwin.so
Expected in: dynamic lookup

@mattmilten
Copy link
Collaborator

Please use the latest versions of SCIP (5.0) and PySCIPOpt (1.3).

@gorbulas
Copy link
Author

Now i use SCIP 5.0 and PySCIPOpt 1.3, but the error is still there.

@mattmilten
Copy link
Collaborator

mattmilten commented Dec 26, 2017 via email

@gorbulas
Copy link
Author

First i use make ZLIB=false ZIMPL=false GMP=false READLINE=false scipoptlib in the folder of scipoptsuite. Then make test and scip has worked for all test problems. Finally i use make install.

To install PySCIPOpt i use export SCIPOPTDIR= with the path to the build of scip and python3 setup.py install in the PySCIPOpt folder to install it for anaconda.

@mattmilten
Copy link
Collaborator

mattmilten commented Dec 26, 2017 via email

@gorbulas
Copy link
Author

Nigther the dmg installer nor using CMake have solved the problem. The tests after using CMake worked.
The error is still:
File "/Users/anaconda3/lib/python3.5/site-packages/PySCIPOpt-1.3.0-py3.5-macosx-10.5-x86_64.egg/pyscipopt/init.py", line 5, in
from pyscipopt.scip import Model

ImportError: dlopen(/Users/anaconda3/lib/python3.5/site-packages/PySCIPOpt-1.3.0-py3.5-macosx-10.5-x86_64.egg/pyscipopt/scip.cpython-35m-darwin.so, 2): Symbol not found: _SCIPnlpiComp
Referenced from: /Users/anaconda3/lib/python3.5/site-packages/PySCIPOpt-1.3.0-py3.5-macosx-10.5-x86_64.egg/pyscipopt/scip.cpython-35m-darwin.so
Expected in: dynamic lookup

For the CMake installation i run cmake GMP=false READLINE=false SHARED=true .. , make , make check and make install.

@mattmilten
Copy link
Collaborator

I am sure that you're not linking to the correct SCIP library. When you're using the old Makefile system you end up with several libs: libscip, liblpi, libnlpi, libobjscip, ... With the new CMake system you wil only get one lib that contains everything so linking is a lot easier. This new lib is also called libscip, though. I strongly believe that you're still linking to the old, incomplete libscip.
Also, your command cmake GMP=false READLINE=false SHARED=true makes no sense. Please refer to the installation instructions for CMake. I hope that you're using the SCIP Optimization Suite and not SCIP alone. In this case the installation boils down to this (run from within the extracted SCIPOptSuite directory):

mkdir build
cd build
cmake ..
make
make install

You should not need to specify the SCIPOPTDIR if you properly installed SCIP in this way. You can test the installation by running scip in the command line within any directory.

Make sure that you remove any old libraries of SCIP that might still be used for PySCIPOpt before installing SCIP.

@mattmilten
Copy link
Collaborator

I'm closing this due to inactivity.

@ggleizer
Copy link

ggleizer commented Jun 8, 2018

I'm having the same issue. I installed the dmg package, pip worked fine, used the DYLD_LIBRARY_PATH setting as some other issue poster suggested... still I get the dlink error when importing in Python. I'm using MacOSX High Sierra and Anaconda (with Python 3.6). This is the error I get.

  File "/Users/ggleizer/anaconda3/lib/python3.6/site-packages/pyscipopt/__init__.py", line 5, in <module>
    from pyscipopt.scip      import Model

ImportError: dlopen(/Users/ggleizer/anaconda3/lib/python3.6/site-packages/pyscipopt/scip.cpython-36m-darwin.so, 2): Library not loaded: libscip.5.0.dylib
  Referenced from: /Users/ggleizer/anaconda3/lib/python3.6/site-packages/pyscipopt/scip.cpython-36m-darwin.so
  Reason: image not found

According to this link, it looks like you can't use DYLD_LIBRARY_PATH with Conda and MacOSX because System Integrity Protection doesn't allow to.

If I do a hard copy of the libraries to my working folder, than it fails because it links to a gmp dynamic library, which I didn't have. After installing GMP, it failed again, and I don't understand the reason. See error below...

ImportError: dlopen(/Users/ggleizer/anaconda3/lib/python3.6/site-packages/pyscipopt/scip.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
  Referenced from: /Users/ggleizer/workingfolder/libscip.5.0.1.0.dylib
  Reason: no suitable image found.  Did find:
	/usr/local/opt/gmp/lib/libgmp.10.dylib: stat() failed with errno=13
	/usr/local/lib/libgmp.10.dylib: stat() failed with errno=13

Any thoughts?

Thanks

@mattmilten
Copy link
Collaborator

Hey @ggleizer, sorry your comment somehow went under my radar.
Do you still have issues installing and running PySCIPOpt with SCIP 6.0? If so, please describe again what goes wrong.
A possible workaround might be to not use the DMG package but rather compile the SCIP lib on your own machine. This way there should not be any missing libraries.

@mattmilten mattmilten reopened this Aug 2, 2018
@arcadianlyric
Copy link

arcadianlyric commented Aug 22, 2018

Hi,
sorry to bother you
similar question:
i installed with .dmg package, and have SCIP version 6.0.0 [precision: 8 byte] [memory: block] [mode: optimized] [LP solver: SoPlex 4.0.0] [GitHash: 77d3bc8]
pip install pyscipopt 'Successfully installed pyscipopt-2.0.1'
but when i tried 'from pyscipopt import Model' i got error:
ImportError: dlopen(/Users/YC/anaconda3/lib/python3.5/site-packages/pyscipopt/scip.cpython-35m-darwin.so, 2): Library not loaded: libscip.6.0.dylib
Referenced from: /Users/YC/anaconda3/lib/python3.5/site-packages/pyscipopt/scip.cpython-35m-darwin.so
Reason: image not found
i see: /lib/libscip.6.0.dylib

i also tried to compile on my own, failed too

what might be the solution ? thank you

@mattmilten
Copy link
Collaborator

Apparently the libscip.dylib cannot be found during runtime. Did you already try the tips from above about DYLD_LIBRARY_PATH, etc?
You need to find a way to make the lib available. You might also try to copy it to some system directory that contains other libs.

@mattmilten
Copy link
Collaborator

@arcadianlyric
Copy link

Thank you for your help, I have it installed on Ubuntu.

@Zialus
Copy link

Zialus commented Aug 23, 2018

This is actually quite curious. I found the following while messing around with Travis CI configs.

On macOS, even though pip install pyscipopt seems to work fine with or without a custom scipoprdir, actually trying to load the library from python seems to fail when using a custom scipoprdir. With Linux, the opposite is true.

macOS:
https://travis-ci.org/Zialus/MAD-Wine-Assignment/jobs/419882588 --> WITHOUT / WORKS
https://travis-ci.org/Zialus/MAD-Wine-Assignment/jobs/419697742 --> WITH / FAILS

Linux:
https://travis-ci.org/Zialus/MAD-Wine-Assignment/jobs/419882584 --> WITHOUT / FAILS
https://travis-ci.org/Zialus/MAD-Wine-Assignment/jobs/419697736 --> WITH / WORKS

@javiervg
Copy link

Hello,

I had a similar problem using the dmg installer, SCIP 6.0 and thanks to the comments on this thread helped me make it work. Thanks, and in case it helps.

Made a symbolic link from the location of the libscip.6.0.dylib to the /usr/local/lib

In terminal,

ln -s {PATH_EXTRACTED_FOLDER}/lib/libscip.6.0.dylib /usr/local/lib/libscip.6.0.dylib

@mattmilten
Copy link
Collaborator

Huh, thanks for that! So it looks like the Linux install is not working correctly or Python does not look up the correct paths. What I really don't understand is why specifying the SCIPOPTDIR is not working on macOS.

@mattmilten mattmilten reopened this Aug 24, 2018
@mattmilten
Copy link
Collaborator

I took inspiration from your travis config @javiervg and modified our setup to use the deb package as global install and it works just fine, see #202. I still don't understand why it wouldn't work with your setup.

@Zialus
Copy link

Zialus commented Aug 25, 2018

@mattmilten I think you meant my appveyor setup.

Anyways, the linux problems shows up when using cmake/make install, not when using .deb

@mattmilten
Copy link
Collaborator

No, I did not mean your appveyor setup. Anyway, it seems that Ubuntu does not look into /usr/local/lib (anymore) for libraries. This was new to me as well and the make/cmake config that installs everything to this location is hence quite useless.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants