pip install bllipparser 在 macos 中出现问题

问题描述 投票:0回答:1

尝试在 python3 虚拟环境中使用 pip install bllipparser 安装时遇到此错误。

Building wheels for collected packages: bllipparser
  Building wheel for bllipparser (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [38 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.macosx-13.0-x86_64-cpython-312
      creating build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/ModelFetcher.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/RerankerFeatureCorpus.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/RerankingParser.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/JohnsonReranker.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/Utility.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/ParsingShell.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/__init__.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/__main__.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      copying python/bllipparser/CharniakParser.py -> build/lib.macosx-13.0-x86_64-cpython-312/bllipparser
      running build_ext
      building 'bllipparser._CharniakParser' extension
      creating build/temp.macosx-13.0-x86_64-cpython-312
      creating build/temp.macosx-13.0-x86_64-cpython-312/first-stage
      creating build/temp.macosx-13.0-x86_64-cpython-312/first-stage/PARSE
      creating build/temp.macosx-13.0-x86_64-cpython-312/first-stage/PARSE/swig
      Compiling with an SDK that doesn't seem to exist: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
      Please check your Xcode installation
      clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -isysroot /path/to/MacOSX10.15.sdk -Ifirst-stage/PARSE/ -I/Volumes/HardDrive/PHENO_HPO/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c first-stage/PARSE/Bchart.C -o build/temp.macosx-13.0-x86_64-cpython-312/first-stage/PARSE/Bchart.o
      clang: warning: no such sysroot directory: '/path/to/MacOSX10.15.sdk' [-Wmissing-sysroot]
      In file included from first-stage/PARSE/Bchart.C:17:
      In file included from first-stage/PARSE/Bchart.h:20:
      In file included from first-stage/PARSE/ChartBase.h:20:
      In file included from first-stage/PARSE/Edge.h:20:
      In file included from first-stage/PARSE/Term.h:21:
      In file included from first-stage/PARSE/ECString.h:15:
      In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:641:
      In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/cstring:60:
      /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/string.h:60:15: fatal error: 'string.h' file not found
      #include_next <string.h>
                    ^~~~~~~~~~
      1 error generated.
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bllipparser
  Running setup.py clean for bllipparser
Failed to build bllipparser
ERROR: Could not build wheels for bllipparser, which is required to install pyproject.toml-based projects

最初,我收到了错误,但将版本更改为 10.15 后错误就消失了:


      Compiling with an SDK that doesn't seem to exist: /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk
      Please check your Xcode installation
      clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk -isysroot /path/to/MacOSX10.15.sdk -Ifirst-stage/PARSE/ -I/Volumes/HardDrive/PHENO_HPO/include -I/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.12/include/python3.12 -c first-stage/PARSE/Bchart.C -o build/temp.macosx-13.0-x86_64-cpython-312/first-stage/PARSE/Bchart.o
      clang: warning: no such sysroot directory: '/path/to/MacOSX10.15.sdk' [-Wmissing-sysroot]
      clang: error: invalid version number in 'MACOSX_DEPLOYMENT_TARGET=13'
      error: command '/usr/bin/clang' failed with exit code 1

有人知道如何解决这个问题吗?我对这个库/设置不是很熟悉,所以任何指导都会有帮助。

谢谢,

python python-3.x macos pip bllip-parser
1个回答
0
投票

事实证明这只是MACOS sdk版本的问题。升级 Xcode 命令行工具解决了该问题。

© www.soinside.com 2019 - 2024. All rights reserved.