[英]SCIP install on m1 mac
I am trying to install scip on my m1 Mac, running on python 3.7我正在尝试在我的 m1 Mac 上安装 scip,在 python 3.7 上运行
I created a terminal that runs in x86_64, and was able to compile scip following these instructions :我创建了一个在 x86_64 中运行的终端,并且能够按照以下说明编译 scip:
Compiling SCIP directly can be done as follows:直接编译 SCIP 可以如下进行:
but I am not sure what to do next.但我不确定下一步该怎么做。 I then tried to pip install pyscipopt but I get the following error:然后我尝试 pip 安装 pyscipopt 但我收到以下错误:
Collecting pyscipopt
Using cached PySCIPOpt-3.1.5.tar.gz (623 kB)
Requirement already satisfied: wheel in /Users/chiennifer/.pyenv/versions/3.7.7/lib/python3.7/site-packages (from pyscipopt) (0.36.2)
Building wheels for collected packages: pyscipopt
Building wheel for pyscipopt (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/chiennifer/.pyenv/versions/3.7.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"'; __file__='"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-wheel-f_3atwka
cwd: /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/
Complete output (39 lines):
Using include path </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src>.
Using SCIP library <scip> at </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/lib>.
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-11.1-x86_64-3.7
creating build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/Multidict.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/__init__.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/scip.pyx -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/scip.pxd -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/propagator.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/heuristic.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/event.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/lp.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/relax.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/benders.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/conshdlr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/benderscut.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/nodesel.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/expr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/branchrule.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/sepa.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/presol.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/pricer.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
running build_ext
building 'pyscipopt.scip' extension
creating build/temp.macosx-11.1-x86_64-3.7
creating build/temp.macosx-11.1-x86_64-3.7/src
creating build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src -I/Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m -c src/pyscipopt/scip.c -o build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt/scip.o
In file included from src/pyscipopt/scip.c:635:
In file included from /usr/local/include/scip/scip.h:35:
/usr/local/include/scip/def.h:43:10: fatal error: 'scip/config.h' file not found
#include "scip/config.h"
^~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyscipopt
Running setup.py clean for pyscipopt
Failed to build pyscipopt
Installing collected packages: pyscipopt
Running setup.py install for pyscipopt ... error
ERROR: Command errored out with exit status 1:
command: /Users/chiennifer/.pyenv/versions/3.7.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"'; __file__='"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-record-uyujqy4v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m/pyscipopt
cwd: /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/
Complete output (39 lines):
Using include path </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src>.
Using SCIP library <scip> at </private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/lib>.
running install
running build
running build_py
creating build
creating build/lib.macosx-11.1-x86_64-3.7
creating build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/Multidict.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/__init__.py -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/scip.pyx -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/scip.pxd -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/propagator.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/heuristic.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/event.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/lp.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/relax.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/benders.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/conshdlr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/benderscut.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/nodesel.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/expr.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/branchrule.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/sepa.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/presol.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
copying src/pyscipopt/pricer.pxi -> build/lib.macosx-11.1-x86_64-3.7/pyscipopt
running build_ext
building 'pyscipopt.scip' extension
creating build/temp.macosx-11.1-x86_64-3.7
creating build/temp.macosx-11.1-x86_64-3.7/src
creating build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/readline/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include -I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/src -I/Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m -c src/pyscipopt/scip.c -o build/temp.macosx-11.1-x86_64-3.7/src/pyscipopt/scip.o
In file included from src/pyscipopt/scip.c:635:
In file included from /usr/local/include/scip/scip.h:35:
/usr/local/include/scip/def.h:43:10: fatal error: 'scip/config.h' file not found
#include "scip/config.h"
^~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/chiennifer/.pyenv/versions/3.7.7/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"'; __file__='"'"'/private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-install-7dve8tcz/pyscipopt_d6deb81abfa54b778aab0b28d10bb306/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/b7/nnczj7h90wn8ds7ht2ljn2l80000gn/T/pip-record-uyujqy4v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/chiennifer/.pyenv/versions/3.7.7/include/python3.7m/pyscipopt Check the logs for full command output.
PySCIPOpt does not work well with the Makefile system of SCIP - you need to build SCIP using CMake as mentioned in the PySCIPOpt installation guide . PySCIPOpt不适用于 SCIP 的 Makefile 系统 - 您需要使用 CMake 构建 SCIP,如PySCIPOpt 安装指南中所述。 This will then generate a shared library and the missing config.h
header.这将生成一个共享库和缺少的config.h
header。
Did you already try using the prebuilt conda packages for PySCIPOpt and SCIP?您是否已经尝试过为 PySCIPOpt 和 SCIP 使用预构建的 conda包?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.