简体   繁体   English

在mac上pip安装pyscipopt - 找不到scip.h文件

[英]pip install pyscipopt on mac - scip.h file not found

Initial Question I've installed scipopsuite by following these instructions: http://scip.zib.de/doc/html/MAKE.php#BRIEFINSTALL初始问题我按照以下说明安装了 scipopsuite: http ://scip.zib.de/doc/html/MAKE.php#BRIEFINSTALL

Make tests - complete without error.进行测试 - 完整无误。

Then when I try pip install pyscipopt I get the following error.然后,当我尝试pip install pyscipopt ,出现以下错误。

src/pyscipopt/scip.c:467:10: fatal error: 'scip/scip.h' file not found
#include "scip/scip.h"
         ^
1 error generated.
error: command 'gcc' failed with exit status 1

Specs: Anaconda Python 2.7, latest OSX规格:Anaconda Python 2.7,最新的 OSX

Follow Up In response to comments(@mattmilten), I've done the following.跟进为了回应评论(@mattmilten),我做了以下工作。

(1) Installed the make file - When i tried to run the install it failed because the name of the O.darwin.x86_64.gnu.shared.opt folder was set to 'static' instead of shared. (1) 安装了 make 文件 - 当我尝试运行安装时它失败了,因为 O.darwin.x86_64.gnu.shared.opt 文件夹的名称被设置为“静态”而不是共享。 I changed that name and then the install completed but did have these warnings:我更改了该名称,然后安装完成,但确实有以下警告:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libscipopt-4.0.0.darwin.x86_64.gnu.opt.a(stkchk.o) has no symbols 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: lib/libscipopt-4.0.0.darwin.x86_64.gnu.opt.a(stkchk.o) has no symbols

When i try:当我尝试:

>>> import pyscipopt

, I now get the following error. ,我现在收到以下错误。

Any suggestions would be appreciated.任何建议将不胜感激。

ImportError: dlopen(/Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so, 2): Symbol not found: ___gmp_version
Referenced from: /Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so
Expected in: flat namespace in /Users/"local"/anaconda/lib/python2.7/site-packages/pyscipopt/scip.so    

I'm guessing these things are linked - thanks.我猜这些东西是有联系的——谢谢。

As explained in the PySCIPOpt INSTALL you need to tell Python where you installed the SCIP Opt Suite: export SCIPOPTDIR=<path_to_install_dir> The setup.py looks for this environment variable so you need to set it before you run pip install pyscipoptPySCIPOpt INSTALL中所述,您需要告诉 Python 您安装 SCIP Opt Suite 的位置: export SCIPOPTDIR=<path_to_install_dir> setup.py查找此环境变量,因此您需要在运行pip install pyscipopt之前设置它

Edit:编辑:

You need to install the SCIP Opt Suite (this basically copies the compiled files to some directory) as also explained in the INSTALL file您需要安装SCIP Opt Suite(这基本上将编译后的文件复制到某个目录),如INSTALL 文件中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM