在 Mac OS X 10.9 上安装 PyLucene 时在符号索引中找不到 Atom

Posted

技术标签:

【中文标题】在 Mac OS X 10.9 上安装 PyLucene 时在符号索引中找不到 Atom【英文标题】:Atom not found in symbol index when installing PyLucene on Mac OS X 10.9 【发布时间】:2014-11-15 18:52:07 【问题描述】:

我正在尝试安装 PyLucene,当我执行“pushd jcc”和“python setup.py build”时,我收到此错误:

ld:内部错误:在 x86_64 架构的 symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) 中找不到原子

可能是什么问题?我安装了 Java 1.7 SDK。我使用“brew install Python”安装了 Python,并在我的 PATH 中的 /urs/bin 之前添加了 /usr/local/bin,以便使用此版本的 Python 2.7.8,而不是 Apple (2.7) 提供的版本。

以下是“python setup.py build”命令输出的一些行:

found JAVAHOME = /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home
found JAVAFRAMEWORKS = /System/Library/Frameworks/JavaVM.framework

writing /Users/administrator/Downloads/pylucene-4.9.0-0/jcc/jcc/config.py
copying jcc/config.py -> build/lib.macosx-10.9-x86_64-2.7/jcc
copying jcc/classes/org/apache/jcc/PythonVM.class -> build/lib.macosx-10.9-x86_64-2.7/jcc/classes/org/apache/jcc
copying jcc/classes/org/apache/jcc/PythonException.class -> build/lib.macosx-10.9-x86_64-2.7/jcc/classes/org/apache/jcc
running build_ext
building 'jcc' extension
clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -dynamiclib -D_jcc_lib -DJCC_VER="2.20" -I/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/include/darwin -I_jcc -Ijcc/sources -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c jcc/sources/jcc.cpp -o build/temp.macosx-10.9-x86_64-2.7/jcc/sources/jcc.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
clang -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -dynamiclib -D_jcc_lib -DJCC_VER="2.20" -I/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/include/darwin -I_jcc -Ijcc/sources -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c jcc/sources/JCCEnv.cpp -o build/temp.macosx-10.9-x86_64-2.7/jcc/sources/JCCEnv.o -DPYTHON -fno-strict-aliasing -Wno-write-strings
clang++ -Wl,-x -dynamiclib -undefined dynamic_lookup -Qunused-arguments -Qunused-arguments build/temp.macosx-10.9-x86_64-2.7/jcc/sources/jcc.o build/temp.macosx-10.9-x86_64-2.7/jcc/sources/JCCEnv.o -o build/lib.macosx-10.9-x86_64-2.7/libjcc.dylib -L/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib -ljava -L/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/server -ljvm -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib -Wl,-rpath -Wl,/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home/jre/lib/server -Wl,-S -install_name @rpath/libjcc.dylib -current_version 2.20 -compatibility_version 2.20
ld: internal error: atom not found in symbolIndex(__ZN7JNIEnv_13CallIntMethodEP8_jobjectP10_jmethodIDz) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang++' failed with exit status 1

【问题讨论】:

【参考方案1】:

您要么需要使用相同的编译器 as described here 从源代码构建 Python,要么以 NO_SHARED 模式构建它。后者是 pylucene 自制配方的默认设置。

【讨论】:

“brew install python”是否从源代码构建 Python?该链接并没有真正解释如何使用相同的编译器从源代码构建 python。

以上是关于在 Mac OS X 10.9 上安装 PyLucene 时在符号索引中找不到 Atom的主要内容,如果未能解决你的问题,请参考以下文章

在 Mac OS X 10.9 上安装 PyLucene 时在符号索引中找不到 Atom

如何在 Mac OS X 10.9 上设置 JAVA_HOME 环境变量?

在 OS X Mavericks 10.9 上安装 apache 2.4

pip 在 Mac OS X Mavericks (10.9) 上引发 stdio.h not found 错误

Mac OS X 10.9 后无法安装 PIL

在 Mac OS X 10.9 中使用 g++ 编译 Rinside