allennlp jsonnet mac 安装失败解决方案

安装命令: pip install jsonnet
报错如下:

lang: 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 'g++' failed with exit status 1
原因说的比较清楚是 libstdc++已经被遗弃了。

解决方案

使用源码安装jsonnet

  1. https://pypi.org/project/jsonnet/#files 下载源码
  2. 解压缩
  3. 执行下面的安装命令 CFLAGS=-stdlib=libc++ python3 setup.py install 或者 sudo CFLAGS=-stdlib=libc++ python3 setup.py install

这样就解决了这个jsonnet的安装问题

其他不work的方案

  1. conda install -c conda-forge jsonnet 我这里始终出错 原因是说 不支持python3.7。我没有尝试改成python3.6,但是不想改回python 3.6
  2. xcode, command line tool 一顿配置等,这些我都尝试了 也不行。

你可能感兴趣的:(allennlp jsonnet mac 安装失败解决方案)