allennlp mac jsonnet 失败

安装命令: 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 一顿配置等,这些我都尝试了 也不行。
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容