1

我正在尝试将 JPype 安装到 Python 虚拟环境中(在安装了 Xcode 和命令行工具的 Mountain Lion 上运行;下面有更多系统详细信息),但我一直遇到 gcc 错误。

~: python setup.py install
running install
running build
running build_py
running build_ext
building '_jpype' extension
gcc -fno-strict-aliasing -fPIC -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -    DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DMACOSX=1 -Isrc/native/common/include -    Isrc/native/python/include -        I/System/Library/Frameworks/JavaVM.framework/Versions/Current//Headers -I/System/Library/Frameworks/JavaVM.framework/Versions/Current//Headers/ -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c     
src/native/common/jp_array.cpp -o build/temp.macosx-10.5-intel-2.7/src/native/common/jp_array.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
src/native/common/jp_array.cpp: In member function ‘void JPArray::setRange(int, int, std::vector<HostRef*, std::allocator<HostRef*> >&)’:
src/native/common/jp_array.cpp:56: warning: comparison between signed and unsigned integer expressions
src/native/common/jp_array.cpp:68: warning: deprecated conversion from string constant to ‘char*’
src/native/common/jp_array.cpp: In member function ‘void JPArray::setItem(int, HostRef*)’:
src/native/common/jp_array.cpp:80: warning: deprecated conversion from string constant to ‘char*’
src/native/common/include/jp_utility.h: At global scope:
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
src/native/common/jp_array.cpp: In member function ‘void JPArray::setRange(int, int, std::vector<HostRef*, std::allocator<HostRef*> >&)’:
src/native/common/jp_array.cpp:56: warning: comparison between signed and unsigned integer expressions
src/native/common/jp_array.cpp:68: warning: deprecated conversion from string constant to ‘char*’
src/native/common/jp_array.cpp: In member function ‘void JPArray::setItem(int, HostRef*)’:
src/native/common/jp_array.cpp:80: warning: deprecated conversion from string constant to ‘char*’
src/native/common/include/jp_utility.h: At global scope:
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
src/native/common/include/jp_utility.h: In instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’:
src/native/common/include/jp_utility.h:38:   instantiated from here
src/native/common/include/jp_utility.h:38: error: explicit instantiation of ‘std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char, _Traits = std::char_traits<char>, _Alloc = std::allocator<char>]’ but no definition available
lipo: can't figure out the architecture type of: /var/folders/v_/cvy9b4hs2_ldpkx6dnxj2bnw0000gn/T//ccKkSzrC.out
error: command 'gcc' failed with exit status 1

作为我认为良好的系统卫生的一部分,我一直在尝试将安装保持在虚拟环境中(~/virtualenvs/default/bin/python),但到目前为止,我唯一的成功是当我使用 sudo 和 2.6 系统版本的 Python:

sudo /usr/bin/python2.6 setup.py install

哪个生产包:

running install
running build
running build_py
running build_ext
running install_lib
copying build/lib.macosx-10.8-intel-2.6/_jpype.so -> /Library/Python/2.6/site-packages
creating /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/__init__.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_core.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_darwin.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_gui.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jarray.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jclass.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jcollection.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jexception.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jobject.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jpackage.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jproxy.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_jwrapper.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_linux.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_properties.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_pykeywords.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_refdaemon.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/_windows.py -> /Library/Python/2.6/site-packages/jpype
creating /Library/Python/2.6/site-packages/jpype/awt
copying build/lib.macosx-10.8-intel-2.6/jpype/awt/__init__.py -> /Library/Python/2.6/site-packages/jpype/awt
creating /Library/Python/2.6/site-packages/jpype/awt/event
copying build/lib.macosx-10.8-intel-2.6/jpype/awt/event/__init__.py -> /Library/Python/2.6/site-packages/jpype/awt/event
copying build/lib.macosx-10.8-intel-2.6/jpype/awt/event/WindowAdapter.py -> /Library/Python/2.6/site-packages/jpype/awt/event
copying build/lib.macosx-10.8-intel-2.6/jpype/findjvm.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/JClassUtil.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/nio.py -> /Library/Python/2.6/site-packages/jpype
copying build/lib.macosx-10.8-intel-2.6/jpype/reflect.py -> /Library/Python/2.6/site-packages/jpype
creating /Library/Python/2.6/site-packages/jpypex
copying build/lib.macosx-10.8-intel-2.6/jpypex/__init__.py -> /Library/Python/2.6/site-packages/jpypex
creating /Library/Python/2.6/site-packages/jpypex/swing
copying build/lib.macosx-10.8-intel-2.6/jpypex/swing/__init__.py -> /Library/Python/2.6/site-packages/jpypex/swing
copying build/lib.macosx-10.8-intel-2.6/jpypex/swing/AbstractAction.py -> /Library/Python/2.6/site-packages/jpypex/swing
copying build/lib.macosx-10.8-intel-2.6/jpypex/swing/pyutils.py -> /Library/Python/2.6/site-packages/jpypex/swing
byte-compiling /Library/Python/2.6/site-packages/jpype/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_core.py to _core.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_darwin.py to _darwin.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_gui.py to _gui.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jarray.py to _jarray.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jclass.py to _jclass.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jcollection.py to _jcollection.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jexception.py to _jexception.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jobject.py to _jobject.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jpackage.py to _jpackage.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jproxy.py to _jproxy.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_jwrapper.py to _jwrapper.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_linux.py to _linux.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_properties.py to _properties.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_pykeywords.py to _pykeywords.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_refdaemon.py to _refdaemon.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/_windows.py to _windows.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/awt/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/awt/event/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/awt/event/WindowAdapter.py to WindowAdapter.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/findjvm.py to findjvm.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/JClassUtil.py to JClassUtil.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/nio.py to nio.pyc
byte-compiling /Library/Python/2.6/site-packages/jpype/reflect.py to reflect.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/swing/__init__.py to __init__.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/swing/AbstractAction.py to AbstractAction.pyc
byte-compiling /Library/Python/2.6/site-packages/jpypex/swing/pyutils.py to pyutils.pyc
running install_egg_info
Writing /Library/Python/2.6/site-packages/JPype-0.5.4.2-py2.6.egg-info

由于将在此过程中创建的站点包复制并粘贴到我的虚拟环境中似乎不起作用,我正在寻找一种解决方案,让我可以使用虚拟环境和我在计算机上使用的 ActiveState Python,但没有'不会产生 gcc 错误。

我还咨询并尝试了以下stackoverflow帖子中的建议,但无济于事:

如何在 OS X Lion 上安装 JPype 以与 Neo4j 一起使用?(这个直接解决了我的问题,但似乎并没有在山狮中解决)

我还确保我使用的是最新的 JPype 设置文件,该文件应该与 Mountain Lion 兼容:

https://github.com/originell/jpype/blob/142cea8ac3924187bcde9057bab62cce15354e37/setup.py

但是,在尝试了目前在线提供的各种解决方案后,包括重新安装 Xcode 和使用

export CC=/usr/bin/g++ 

试图强制使用不同的编译器,到目前为止没有任何效果。

**Python Details:**
ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:20:15) 
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin

**Java Details:**
java version "1.6.0_35"
Java(TM) SE Runtime Environment (build 1.6.0_35-b10-428-11M3811)
Java HotSpot(TM) 64-Bit Server VM (build 20.10-b01-428, mixed mode)
4

0 回答 0