简体   繁体   English

我如何在 mac os 上安装 quadprog

[英]how do i install quadprog on mac os

I'm having some difficulty installing quadprog on macOS under Python 3.6.我在 Python 3.6 下在 macOS 上安装quadprog时遇到了一些困难。 I've tried numerous solutions but nothing seems to be working.我尝试了许多解决方案,但似乎没有任何效果。

What I need to install is trajectory_planning_helpers and it needs quadprog .我需要安装的是trajectory_planning_helpers ,它需要quadprog This is the error that I'm getting when I enter the command pip3 install quadprog :这是我输入命令pip3 install quadprog

3 warnings generated.
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/aind.c -o build/temp.macosx-10.6-intel-3.6/quadprog/aind.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/solve.QP.c -o build/temp.macosx-10.6-intel-3.6/quadprog/solve.QP.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/util.c -o build/temp.macosx-10.6-intel-3.6/quadprog/util.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/dpofa.c -o build/temp.macosx-10.6-intel-3.6/quadprog/dpofa.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/daxpy.c -o build/temp.macosx-10.6-intel-3.6/quadprog/daxpy.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/ddot.c -o build/temp.macosx-10.6-intel-3.6/quadprog/ddot.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/dscal.c -o build/temp.macosx-10.6-intel-3.6/quadprog/dscal.o
    /usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iquadprog -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c quadprog/f2c_lite.c -o build/temp.macosx-10.6-intel-3.6/quadprog/f2c_lite.o
    creating build/lib.macosx-10.6-intel-3.6
    /usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.6/quadprog/quadprog.o build/temp.macosx-10.6-intel-3.6/quadprog/aind.o build/temp.macosx-10.6-intel-3.6/quadprog/solve.QP.o build/temp.macosx-10.6-intel-3.6/quadprog/util.o build/temp.macosx-10.6-intel-3.6/quadprog/dpofa.o build/temp.macosx-10.6-intel-3.6/quadprog/daxpy.o build/temp.macosx-10.6-intel-3.6/quadprog/ddot.o build/temp.macosx-10.6-intel-3.6/quadprog/dscal.o build/temp.macosx-10.6-intel-3.6/quadprog/f2c_lite.o -o build/lib.macosx-10.6-intel-3.6/quadprog.cpython-36m-darwin.so
    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
    ld: library not found for -lstdc++
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command '/usr/bin/clang++' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/r3/42nmx6bs2gbgxj3gm1hcl6_00000gn/T/pip-install-fvpe_m9v/quadprog/setup.py'"'"'; __file__='"'"'/private/var/folders/r3/42nmx6bs2gbgxj3gm1hcl6_00000gn/T/pip-install-fvpe_m9v/quadprog/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/r3/42nmx6bs2gbgxj3gm1hcl6_00000gn/T/pip-record-0k3qjcbz/install-record.txt --single-version-externally-managed --compile Check the logs for full command output

I tried with Python 3.7 on my macbook and it got installed properly.我在我的 macbook 上尝试使用 Python 3.7,它安装正确。

Based on the error message provided by you, I suspect that the problem could be either with the Python version (3.6) or with lstdc++ version (10.6)根据您提供的错误消息,我怀疑问题可能出在 Python 版本 (3.6) 或 lstdc++ 版本 (10.6) 上

Can you try upgrading Python to version 3.7 and then install quadprog?您可以尝试将 Python 升级到 3.7 版,然后安装 quadprog 吗?

Here is the installation that worked for Python 3.7这是适用于 Python 3.7 的安装

$ pip3 install quadprog

Collecting quadprog Downloading https://files.pythonhosted.org/packages/.../quadprog-0.1.7.tar.gz收集 quadprog 下载https://files.pythonhosted.org/packages/.../quadprog-0.1.7.ta​​r.gz

Collecting Cython (from quadprog) Downloading https://files.pythonhosted.org/packages/.../Cython-0.29.14-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (2.9MB)收集 Cython(来自 quadprog) 下载https://files.pythonhosted.org/packages/.../Cython-0.29.14-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_4_10_64.macosx_106_64.macosx_16_10_10

.... ....

Installing collected packages: Cython, quadprog安装收集到的包:Cython、quadprog

Running setup.py install for quadprog ... done为 quadprog 运行 setup.py install ... 完成

Successfully installed Cython-0.29.14 quadprog-0.1.7成功安装 Cython-0.29.14 quadprog-0.1.7

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

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