作者:瑶2012瑶_881 | 来源:互联网 | 2022-12-01 11:11
尝试在Mac上使用pip install安装cvxpy软件包时,收到以下错误消息:
warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
In file included from cvxpy/cvxcore/src/cvxcore.cpp:15:
cvxpy/cvxcore/src/cvxcore.hpp:18:10: fatal error: 'vector' file not found
#include
^~~~~~~~
1 warning and 1 error generated.
error: command '/usr/bin/clang' failed with exit status 1
Mac正在运行OS Mojave.
1> Pubudu Dodan..:
我使用以下步骤解决了该问题,
首先,我尝试更改标志以指示安装使用libc++
,
CFLAGS=-stdlib=libc++ pip install cvxpy
然后它抱怨有一个invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later)
。
然后,我运行以下命令来设置部署目标,
export MACOSX_DEPLOYMENT_TARGET=10.10
然后,运行第一个命令(CFLAGS=-stdlib=libc++ pip install cvxpy
)再次成功安装了cvxpy。
这为我解决了。非常感谢