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的更多相关文章

  1. xcode 运行报错 Command /usr/bin/codesign failed with exit code 1

           因为更换了证书,导致在运行时报错 Command /usr/bin/codesign failed with exit code 1,查看了网上各种方法,最后发现以下两个值没有同步更新

  2. 安装matplotlib,报错ERROR: Command errored out with exit status 1:

    使用pip install matplotlib 出现报错信息: 发现这行报错 : 我是在pycharm上安装的,可是提示我去安装 Microsoft Visual C++ ,然后去百度查了下,发现只 ...

  3. no identity found Command /usr/bin/codesign failed with exit code 1 报错解决方法

    stackoverflow 的解决方法是 xcode->preference->account->view detail -> refresh the provisioning ...

  4. xcode6 真机运行报错 Command /usr/bin/codesign failed with exit code 1

    解决方法: 百度下载‘iphone配置实用工具’, 打开此软件之后,选择预配置描述文件, 选中iphone过期和重复的描述文件,按delete键删除.然后重启xcode即可

  5. 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操作系统上安装 ...

  6. 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 添加如下几 ...

  7. 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 ...

  8. python安装模块的时候报错error: command 'gcc' failed with exit status 1

    [情况] 在写Python代码的时候,需要用到psutil模块,需要安装. 但是在安装时,报错:error: command 'gcc' failed with exit status 1 [解决步骤 ...

  9. [原创] 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 ...

随机推荐

  1. HTTP协议随笔

    代理 代理就是处在客户端和服务端之间的服务器.客户端例如浏览器发送GET请求时,代理服务器接收该请求,并转发该请求至服务所在的服务器.服务器回复的数据和资源在第一时间经过代理服务器,才能回传到浏览器, ...

  2. SQL Server外键关系是强制约束,外键值也可以是空(NULL)

    在SQL Server中,实际上外键值可不可以为空(NULL),和外键关系是不是强制约束无关. 我们先在SQL Server数据库中建立两张表People和Car,一个People可以有多个Car,所 ...

  3. java基础 接口私有方法

    /** * 问题描述: * 我们需要抽取一个共有方法,用来解决两个默认方法之间重复代码的问题 * 但是这个共有方法不应该让实现类使用,应该是私有化的. * * 解决方案: * 从java 9开始,接口 ...

  4. java加密解密工具类

    package com.founder.mrp.util; import java.nio.charset.StandardCharsets; import java.security.Key; im ...

  5. C# 调用JS Eval,高效率

    /// <summary> /// 动态计算表达式 /// </summary> class JSCaller { /// <summary> /// 动态计算表达 ...

  6. [MySql] - Windows MySql 8.x 手动zip包安装与外网访问登录权限设定

    MySql 8.x官方下载地址 https://dev.mysql.com/downloads/mysql/8.0.html https://cdn.mysql.com//Downloads/MySQ ...

  7. 给基于对话框的MFC程序添加状态栏并实时显示时间

    转载自丝雪儿 1.首先在string table 里添加两个字串,ID分别为IDS_INDICATOR_MESSAGE and IDS_INDICATOR_TIME 2.在你的 dlg.h 类里面加个 ...

  8. 美团点评CAT监控平台研究

    1. 美团点评CAT监控平台研究 1.1. 前言 此文根据我对官方文档阅读并记录整理所得,中间可能会穿插一些自己的思考和遇坑 1.2. 简介 CAT 是基于 Java 开发的实时应用监控平台,为美团点 ...

  9. vue中的插槽

    匿名插槽 // comp1 <div> <slot></slot> </div> // parent <comp>hello</com ...

  10. rabbitmq:配置rabbitmq-management插件

    rabbitmq提供了一个图形的管理界面,用于管理.监控rabbitmq的运行情况,它是以插件的形式提供的,如果要启用需要启用插件 一.启用插件 rabbitmq-plugins enable rab ...