Mac OS中的Pip安装错误(错误:命令'/usr/bin/clang'失败,退出状态为1) [英] Pip install error in Mac OS(error: command '/usr/bin/clang' failed with exit status 1)

查看:58
本文介绍了Mac OS中的Pip安装错误(错误:命令'/usr/bin/clang'失败,退出状态为1)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过在Mac OS上进行pip3安装来安装JPype1.

I want to install JPype1 via pip3 installation on Mac OS.

$ pip3 install JPype1 

但是,以下错误反复发生.

However, the following error happens again and again.

Collecting JPype1 
Using cached https://files.pythonhosted.org/packages/c4/4b/60a3e63d51714d4d7ef1b1efd
f84315d118a0a80a5b085bb52a7e2428cdc/JPype1-0.6.3.tar.gz
Installing collected packages: JPype1
Running setup.py install for JPype1 ... error
Complete output from command /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/_t/j4yyfrs972scc4kbnzmqw_d80000gn/T/pip-install-ikitwbg0/JPype1/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/_t/j4yyfrs972scc4kbnzmqw_d80000gn/T/pip-record-el7dtlip/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.6-intel-3.6
creating build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jcollection.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_classpath.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jio.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_pykeywords.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jproxy.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_gui.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_darwin.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/nio.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_cygwin.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_properties.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/__init__.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_refdaemon.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jboxed.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/JClassUtil.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jvmfinder.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/imports.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_core.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_linux.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jarray.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jobject.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jclass.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_windows.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jwrapper.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jexception.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/reflect.py -> build/lib.macosx-10.6-intel-3.6/jpype
copying jpype/_jpackage.py -> build/lib.macosx-10.6-intel-3.6/jpype
creating build/lib.macosx-10.6-intel-3.6/jpype/awt
copying jpype/awt/__init__.py -> build/lib.macosx-10.6-intel-3.6/jpype/awt
creating build/lib.macosx-10.6-intel-3.6/jpype/awt/event
copying jpype/awt/event/__init__.py -> build/lib.macosx-10.6-intel-3.6/jpype/awt/event
copying jpype/awt/event/WindowAdapter.py -> build/lib.macosx-10.6-intel-3.6/jpype/awt/event
creating build/lib.macosx-10.6-intel-3.6/jpypex
copying jpypex/__init__.py -> build/lib.macosx-10.6-intel-3.6/jpypex
creating build/lib.macosx-10.6-intel-3.6/jpypex/swing
copying jpypex/swing/AbstractAction.py -> build/lib.macosx-10.6-intel-3.6/jpypex/swing
copying jpypex/swing/__init__.py -> build/lib.macosx-10.6-intel-3.6/jpypex/swing
copying jpypex/swing/pyutils.py -> build/lib.macosx-10.6-intel-3.6/jpypex/swing
running build_ext
/private/var/folders/_t/j4yyfrs972scc4kbnzmqw_d80000gn/T/pip-install-ikitwbg0/JPype1/setup.py:173: FeatureNotice: Turned ON Numpy support for fast Java array access
  FeatureNotice)
building '_jpype' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/native
creating build/temp.macosx-10.6-intel-3.6/native/python
creating build/temp.macosx-10.6-intel-3.6/native/common
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -DMACOSX=1 -DHAVE_NUMPY=1 -Inative/common/include -Inative/python/include -Inative/jni_include -I/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c native/python/jpype_python.cpp -o build/temp.macosx-10.6-intel-3.6/native/python/jpype_python.o -ggdb
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]
In file included from native/python/jpype_python.cpp:19:
In file included from native/python/include/jpype_python.h:24:
native/common/include/jpype.h:107:10: fatal error: 'map' file not found
#include <map>
         ^~~~~
1 warning and 1 error generated.


error: command '/usr/bin/clang' failed with exit status 1

Command "/Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 -u -c 
"import setuptools, tokenize;__file__='/private/var/folders/_t/j4yyfrs972scc4kbnzmqw
_d80000gn/T/pip-install-m85m9kdb/JPype1/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/_t/j4yyfrs972scc4kbnzmqw_d80000gn/T
/pip-record-yzt5gaag/install-record.txt --single-version-externally-managed --compil
e" failed with error code 1 in /private/var/folders/_t/j4yyfrs972scc4kbnzmqw_d80000g
n/T/pip-install-m85m9kdb/JPype1/

其他问答题则要求使用Xcode来解决此问题.但是,即使使用此代码安装了XCode,它也无法解决该错误.

Other question-answers say that Xcode is required to solve this. However, even after I installed XCode with this code, it doesn't solve the error.

 $ xcode-select --install

(以及Appstore下载)

(and also with Appstore download)

有人可以帮助我吗?

推荐答案

对于macOS Mojave,请先调用 export CFLAGS ='-stdlib = libc ++',然后再调用 python setup.py install

For macOS Mojave, play with export CFLAGS='-stdlib=libc++' before calling python setup.py install

这篇关于Mac OS中的Pip安装错误(错误:命令'/usr/bin/clang'失败,退出状态为1)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆