在conda/M上安装带pip的mmh3包

2024-09-29 17:20:27 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我尝试在MacOS上安装一个需要mmh3的包。在

当我到了那里-我得到的错误,无论出于何种意图和目的,对我来说都可能是不同的语言。在

到目前为止的搜索结果让我相信这与我电脑上的苹果xCode版本有关,但我找到的答案完全没有意义。如果我所做的只是调用pip install mmh3,我不知道如何编辑安装文件。在

输出如下,我知道它很长-但我不知道什么是相关的和不相关的,所以它都在那里。这跟苹果公司改名c++或者类似的东西有关。任何帮助都将不胜感激。请记住,我不知道为什么需要这个包裹,只是它是。在

Collecting mmh3
  Using cached https://files.pythonhosted.org/packages/fa/7e/3ddcab0a9fcea034212c02eb411433db9330e34d626360b97333368b4052/mmh3-2.5.1.tar.gz
Building wheels for collected packages: mmh3
  Running setup.py bdist_wheel for mmh3 ... error
  Complete output from command /Users/ronan/miniconda3/envs/prodigy/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-install-qieyu8iz/mmh3/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-wheel-a0npl5pu --python-tag cp37:
  running bdist_wheel
  running build
  running build_ext
  building 'mmh3' extension
  creating build
  creating build/temp.macosx-10.7-x86_64-3.7
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include/python3.7m -c mmh3module.cpp -o build/temp.macosx-10.7-x86_64-3.7/mmh3module.o
  warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  1 warning generated.
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include/python3.7m -c MurmurHash3.cpp -o build/temp.macosx-10.7-x86_64-3.7/MurmurHash3.o
  warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  1 warning generated.
  creating build/lib.macosx-10.7-x86_64-3.7
  g++ -bundle -undefined dynamic_lookup -L/Users/ronan/miniconda3/envs/prodigy/lib -arch x86_64 -L/Users/ronan/miniconda3/envs/prodigy/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.7/mmh3module.o build/temp.macosx-10.7-x86_64-3.7/MurmurHash3.o -o build/lib.macosx-10.7-x86_64-3.7/mmh3.cpython-37m-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 'g++' failed with exit status 1

  ----------------------------------------
  Failed building wheel for mmh3
  Running setup.py clean for mmh3
Failed to build mmh3
Installing collected packages: mmh3
  Running setup.py install for mmh3 ... error
    Complete output from command /Users/ronan/miniconda3/envs/prodigy/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-install-qieyu8iz/mmh3/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/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-record-z9u9z7f5/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_ext
    building 'mmh3' extension
    creating build
    creating build/temp.macosx-10.7-x86_64-3.7
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include/python3.7m -c mmh3module.cpp -o build/temp.macosx-10.7-x86_64-3.7/mmh3module.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include -arch x86_64 -I/Users/ronan/miniconda3/envs/prodigy/include/python3.7m -c MurmurHash3.cpp -o build/temp.macosx-10.7-x86_64-3.7/MurmurHash3.o
    warning: include path for stdlibc++ headers not found; pass '-std=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    1 warning generated.
    creating build/lib.macosx-10.7-x86_64-3.7
    g++ -bundle -undefined dynamic_lookup -L/Users/ronan/miniconda3/envs/prodigy/lib -arch x86_64 -L/Users/ronan/miniconda3/envs/prodigy/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-3.7/mmh3module.o build/temp.macosx-10.7-x86_64-3.7/MurmurHash3.o -o build/lib.macosx-10.7-x86_64-3.7/mmh3.cpython-37m-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 'g++' failed with exit status 1

    ----------------------------------------
Command "/Users/ronan/miniconda3/envs/prodigy/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-install-qieyu8iz/mmh3/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/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-record-z9u9z7f5/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/29/638ydzz51zxfm1hht53r24w80000gn/T/pip-install-qieyu8iz/mmh3/

Tags: installbuildforincludelibcodeusersx86
1条回答
网友
1楼 · 发布于 2024-09-29 17:20:27

所以,和往常一样,在你看过之后,答案非常简单。在

解决此问题的方法以及依赖于Python引用的C++库的其他解决方案是在实现包时使用的^ {CD1>}文件中的IF/EXE块。如果在OSX>;=10.7上运行,包含和执行的以下代码行将解决pip和Python的此类投诉。在

COMPILE_OPTIONS["other"].append("-stdlib=libc++")
LINK_OPTIONS["other"].append("-lc++")
LINK_OPTIONS["other"].append("-nodefaultlibs")

作为参考,here是关于问题来源的一些信息。在

解决方案的功劳应该归于@honnibal,完整的if/else逻辑和块现在可以通过this link获得,所以您可以有一个squiz来查看发生了什么。在

相关问题 更多 >

    热门问题