Mac 无法安装安装psutil 报错 error: command '/usr/bin/clang' failed with exit status 1
psutil是一个特别好用来检查系统资源的一个包, 但是 在Mac安装却总是报错
mac系统版本: Macos Mojave 10.14.3
报错信息如下:
WARNING: The directory '/Users/msw/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
WARNING: The directory '/Users/msw/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting psutil
Downloading https://files.pythonhosted.org/packages/03/9a/95c4b3d0424426e5fd94b5302ff74cea44d5d4f53466e1228ac8e73e14b4/psutil-5.6.5.tar.gz (447kB)
|████████████████████████████████| 450kB 153kB/s
Building wheels for collected packages: psutil
Building wheel for psutil (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-c9s3nce8/psutil/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-c9s3nce8/psutil/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/tmp/pip-wheel-v0_0pfgx --python-tag cp36
cwd: /private/tmp/pip-install-c9s3nce8/psutil/
Complete output (106 lines):
running bdist_wheel
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/psutil
copying psutil/_pswindows.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_common.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/__init__.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psosx.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psbsd.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psaix.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pslinux.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_compat.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psposix.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pssunos.py -> build/lib.macosx-10.6-intel-3.6/psutil
creating build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/runner.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/__main__.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
running build_ext
building 'psutil._psutil_osx' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/psutil
creating build/temp.macosx-10.6-intel-3.6/psutil/arch
creating build/temp.macosx-10.6-intel-3.6/psutil/arch/osx
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=565 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_common.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_common.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=565 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_posix.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_posix.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=565 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_osx.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_osx.o
In file included from psutil/_psutil_osx.c:36:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
# error Never include this file directly. Use <lzma.h> instead.
^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
lzma_check check;
^
/usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
lzma_vli compressed_size;
^
/usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
lzma_vli uncompressed_size;
^
/usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
lzma_filter *filters;
^
/usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
^
/usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int3;
^
/usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int4;
^
/usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int5;
^
/usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int6;
^
/usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int7;
^
/usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int8;
^
/usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum1;
^
/usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum2;
^
/usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum3;
^
/usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum4;
^
/usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
lzma_bool ignore_check;
^
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool2;
^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool3;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
Installing collected packages: psutil
Running setup.py install for psutil ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-c9s3nce8/psutil/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-c9s3nce8/psutil/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/tmp/pip-record-syvhpqg0/install-record.txt --single-version-externally-managed --compile
cwd: /private/tmp/pip-install-c9s3nce8/psutil/
Complete output (106 lines):
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/psutil
copying psutil/_pswindows.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_common.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/__init__.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psosx.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psbsd.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psaix.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pslinux.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_compat.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_psposix.py -> build/lib.macosx-10.6-intel-3.6/psutil
copying psutil/_pssunos.py -> build/lib.macosx-10.6-intel-3.6/psutil
creating build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/runner.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_aix.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
copying psutil/tests/__main__.py -> build/lib.macosx-10.6-intel-3.6/psutil/tests
running build_ext
building 'psutil._psutil_osx' extension
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/psutil
creating build/temp.macosx-10.6-intel-3.6/psutil/arch
creating build/temp.macosx-10.6-intel-3.6/psutil/arch/osx
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=565 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_common.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_common.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=565 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_posix.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_posix.o
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=565 -DPSUTIL_OSX=1 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c psutil/_psutil_osx.c -o build/temp.macosx-10.6-intel-3.6/psutil/_psutil_osx.o
In file included from psutil/_psutil_osx.c:36:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:43:
In file included from /System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:72:
/usr/local/include/Block.h:16:3: error: Never include this file directly. Use <lzma.h> instead.
# error Never include this file directly. Use <lzma.h> instead.
^
/usr/local/include/Block.h:93:2: error: unknown type name 'lzma_check'
lzma_check check;
^
/usr/local/include/Block.h:148:2: error: unknown type name 'lzma_vli'
lzma_vli compressed_size;
^
/usr/local/include/Block.h:172:2: error: unknown type name 'lzma_vli'
lzma_vli uncompressed_size;
^
/usr/local/include/Block.h:200:2: error: unknown type name 'lzma_filter'
lzma_filter *filters;
^
/usr/local/include/Block.h:217:20: error: use of undeclared identifier 'LZMA_CHECK_SIZE_MAX'
uint8_t raw_check[LZMA_CHECK_SIZE_MAX];
^
/usr/local/include/Block.h:231:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int3;
^
/usr/local/include/Block.h:232:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int4;
^
/usr/local/include/Block.h:233:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int5;
^
/usr/local/include/Block.h:234:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int6;
^
/usr/local/include/Block.h:235:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int7;
^
/usr/local/include/Block.h:236:2: error: unknown type name 'lzma_vli'
lzma_vli reserved_int8;
^
/usr/local/include/Block.h:237:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum1;
^
/usr/local/include/Block.h:238:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum2;
^
/usr/local/include/Block.h:239:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum3;
^
/usr/local/include/Block.h:240:2: error: unknown type name 'lzma_reserved_enum'
lzma_reserved_enum reserved_enum4;
^
/usr/local/include/Block.h:261:2: error: unknown type name 'lzma_bool'
lzma_bool ignore_check;
^
/usr/local/include/Block.h:263:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool2;
^
/usr/local/include/Block.h:264:2: error: unknown type name 'lzma_bool'
lzma_bool reserved_bool3;
^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
error: command '/usr/bin/clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.6/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/tmp/pip-install-c9s3nce8/psutil/setup.py'"'"'; __file__='"'"'/private/tmp/pip-install-c9s3nce8/psutil/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/tmp/pip-record-syvhpqg0/install-record.txt --single-version-externally-managed --compile Check the logs for full command output.
解决方案如下:
brew doctor
rm /usr/local/include/block.h
pip3 install psutil
即可见到久违的安装成功提示
Successfully installed psutil-5.6.5
亲测有效哦!
Mac 无法安装安装psutil 报错 error: command '/usr/bin/clang' failed with exit status 1的更多相关文章
- xcode 运行报错 Command /usr/bin/codesign failed with exit code 1
因为更换了证书,导致在运行时报错 Command /usr/bin/codesign failed with exit code 1,查看了网上各种方法,最后发现以下两个值没有同步更新
- 安装matplotlib,报错ERROR: Command errored out with exit status 1:
使用pip install matplotlib 出现报错信息: 发现这行报错 : 我是在pycharm上安装的,可是提示我去安装 Microsoft Visual C++ ,然后去百度查了下,发现只 ...
- no identity found Command /usr/bin/codesign failed with exit code 1 报错解决方法
stackoverflow 的解决方法是 xcode->preference->account->view detail -> refresh the provisioning ...
- xcode6 真机运行报错 Command /usr/bin/codesign failed with exit code 1
解决方法: 百度下载‘iphone配置实用工具’, 打开此软件之后,选择预配置描述文件, 选中iphone过期和重复的描述文件,按delete键删除.然后重启xcode即可
- windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help
windows 8 安装 oracle 11g 报错:command line option syntax error,type command/? for help 在windows8操作系统上安装 ...
- php源码安装执行configure报错error: off_t undefined; check your library configuration
php安装执行configure报错error: off_t undefined; check your library configuration vim /etc/ld.so.conf 添加如下几 ...
- iOS开发之--png图片编译时报错 (Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng failed with exit code 1 )
编译或者运行APP的时候,老是报这个错误:Command /Applications/Xcode.app/Contents/Developer/usr/bin/copypng failed with ...
- python安装模块的时候报错error: command 'gcc' failed with exit status 1
[情况] 在写Python代码的时候,需要用到psutil模块,需要安装. 但是在安装时,报错:error: command 'gcc' failed with exit status 1 [解决步骤 ...
- [原创] ubuntu下安装scrapy报错 error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Ubuntu14.04在virtualenv下安装scrapy报错,Failed building wheel for cffi,lxml,cryptography 等. error: command ...
随机推荐
- Oracle排序(中文)
一.中文排序 1. 按照笔划排序 select * from dept order by nlssort(name,'NLS_SORT=SCHINESE_STROKE_M'); ...
- 给定一个长度为N的数组,找出出现次数大于n/2,n/3的数,要求时间复杂度O(n),空间复杂度O(1)
先讨论出现次数大于n/2的数字,如果这样的数字存在,那么这个数出现的次数大于其他数出现的次数的总和. 在数组A中,我们定义两个数据集合a1,a2.a1为出现次数大于n/2的数的集合,a2为其余数组成的 ...
- Windows服务的安装及配合定时器编写简单的程序
最近要实时统计一些数据,所以就用到了Windows服务及定时任务,在这里记录下. Windows Service简介: 一个Windows服务程序是在Windows操作系统下能完成特定功能的可执行的应 ...
- C#拼音帮助类
如果使用此帮助类需要引用 using Microsoft.International.Converters.PinYinConverter; using NPinyin; 可以在NuGet里面下载 1 ...
- Jenkins首次进入的一些设置及配置
1.将Jenkins显示页面修改为中文环境 首先安装中文的插件:在manage Jenkins-Manage Plugins-可选插件 下载完成之后,在系统设置里边,修改为中文格式:manage Je ...
- [转]Python实现字符串反转的几种方法
#第一种:使用字符串切片 result = s[::-1] #第二种:使用列表的reverse方法 l = list(s) l.reverse() result = "".join ...
- .Net Core 遇到 “'windows-1252' is not a supported encoding name.”
最近用 iTextSharp 拆分 Pdf 文档 加水印的时候遇到错误: 'windows-1252' is not a supported encoding name. For informatio ...
- springboot脚手架liugh-parent源码研究参考
1. liugh-parent源码研究参考 1.1. 前言 这也是个开源的springboot脚手架项目,这里研究记录一些该框架写的比较好的代码段和功能 脚手架地址 1.2. 功能 1.2.1. 当前 ...
- Ingress使用示例
Ingress概念介绍 service只能做四层代理 无法做七层代理(如https服务) lvs只能根据第四层的数据进行转发 无法对七层协议数据进行调度 Ingress Controller ...
- IDEA编码时卡顿问题
当代码行数超过2000行,甚至更多时会出现编码时卡顿到无法编译的情况,解决方法如下: 方法1:修改IDEA配置参数 找到D:\ideaIU-2019.1.1.win\bin\idea64.exe.vm ...