python - 在 Mac 10.14 上使用 pip 安装 python-igraph 失败,并出现“找不到 -lstdc++ 的库”
问题描述
我正在尝试在 Mac OS X 10.14 上python-igraph
安装pip3
,但安装失败并显示以下错误消息:
$ pip3 install python-igraph
...snip...
gcc -bundle -undefined dynamic_lookup -L/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib -arch x86_64 -L/Users/charles/.pyenv/versions/miniconda3-4.3.30/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.6/src/edgeobject.o build/temp.macosx-10.7-x86_64-3.6/src/common.o build/temp.macosx-10.7-x86_64-3.6/src/py2compat.o build/temp.macosx-10.7-x86_64-3.6/src/graphobject.o build/temp.macosx-10.7-x86_64-3.6/src/indexing.o build/temp.macosx-10.7-x86_64-3.6/src/igraphmodule.o build/temp.macosx-10.7-x86_64-3.6/src/bfsiter.o build/temp.macosx-10.7-x86_64-3.6/src/convert.o build/temp.macosx-10.7-x86_64-3.6/src/vertexobject.o build/temp.macosx-10.7-x86_64-3.6/src/random.o build/temp.macosx-10.7-x86_64-3.6/src/edgeseqobject.o build/temp.macosx-10.7-x86_64-3.6/src/error.o build/temp.macosx-10.7-x86_64-3.6/src/vertexseqobject.o build/temp.macosx-10.7-x86_64-3.6/src/arpackobject.o build/temp.macosx-10.7-x86_64-3.6/src/attributes.o build/temp.macosx-10.7-x86_64-3.6/src/filehandle.o build/temp.macosx-10.7-x86_64-3.6/src/pyhelpers.o igraphcore/lib/libigraph.a -Ligraphcore/lib -L/usr/local/lib -L/usr/lib -lxml2 -lz -lm -lstdc++ -o build/lib.macosx-10.7-x86_64-3.6/igraph/_igraph.cpython-36m-darwin.so
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 'gcc' failed with exit status 1
gcc 版本:
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
蟒蛇版本:
$ python3 --version
Python 3.6.7
(旁注,python
andpython3
指向同一个 python,pip
andpip3
指向同一个(对应的)pip。)
我也尝试运行xcode-select --install
,但这告诉我'命令行工具已经安装,使用“软件更新”安装更新'(Xcode 是最新的)。
解决方案
跑
export MACOSX_DEPLOYMENT_TARGET=10.9
在运行之前pip install python-igraph
。然后你应该看到它安装成功:
$ pip install python-igraph
Collecting python-igraph
Using cached https://files.pythonhosted.org/packages/0f/a0/4e7134f803737aa6eebb4e5250565ace0e2599659e22be7f7eba520ff017/python-igraph-0.7.1.post6.tar.gz
Building wheels for collected packages: python-igraph
Running setup.py bdist_wheel for python-igraph ... done
Stored in directory: /Users/charles/Library/Caches/pip/wheels/41/d6/02/34eebae97e25f5b87d60f4c0687e00523e3f244fa41bc3f4a7
Successfully built python-igraph
Installing collected packages: python-igraph
Successfully installed python-igraph-0.7.1.post6
推荐阅读
- db2 - DB2 UPGRADE DB “SQL0954C 应用程序堆中没有足够的存储空间来处理语句。SQLSTATE=57011”
- c# - 如何使用 asp.net core 2 中间件包装 graphql.net 端点响应?
- android - 编译 tensorflow lite 最小示例
- javascript - 如何在 React 中使用带有钩子的生命周期方法?
- git - 始终创建新的 Git 分支,即使是微小的/微不足道的更改
- python - 如何在 pandas 数据框中使用单引号将一列拆分为两列?
- powershell - 需要 Powershell 脚本从目录和子目录中的 *.msg 文件中删除所有空格
- python - 类中的类似方法
- javascript - 单击一个元素会触发所有相同的类,而不是单击的那个
- adobe-xd - 我正在全局更改打开的 XD 文档,但收到以下错误