天飞 学习笔记


  • 首页

  • 关于

  • 标签

  • 分类

  • 归档

  • 公益404

  • 搜索

pip安装psutil报错

发表于 2017-09-05 | 更新于: 2019-11-08   |   更新于 2019-11-08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
(v_python3.6) htf@linux-rzt3:~/PycharmProjects/python3.6/ServiceConnectEvolution> pip install psutil
Collecting psutil
Using cached psutil-5.3.0.tar.gz
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... error
Complete output from command /home/htf/.virtualenvs/v_python3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dzgqgruh/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 /tmp/tmpsz_sd5awpip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
creating build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psutil
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=530 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
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
Complete output from command /home/htf/.virtualenvs/v_python3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dzgqgruh/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 /tmp/pip-h40wc998-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/htf/.virtualenvs/v_python3.6/include/site/python3.6/psutil:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/psutil
copying psutil/_compat.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psosx.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psposix.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pssunos.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/__init__.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_psbsd.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_common.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pswindows.py -> build/lib.linux-x86_64-3.6/psutil
copying psutil/_pslinux.py -> build/lib.linux-x86_64-3.6/psutil
creating build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_memory_leaks.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_process.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_system.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__main__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/__init__.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-3.6/psutil/tests
copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-3.6/psutil/tests
running build_ext
building 'psutil._psutil_linux' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/psutil
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -DOPENSSL_LOAD_CONF -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fmessage-length=0 -grecord-gcc-switches -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -g -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_VERSION=530 -DPSUTIL_LINUX=1 -I/usr/include/python3.6m -c psutil/_psutil_common.c -o build/temp.linux-x86_64-3.6/psutil/_psutil_common.o
psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
#include <Python.h>
^~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/home/htf/.virtualenvs/v_python3.6/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dzgqgruh/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 /tmp/pip-h40wc998-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/htf/.virtualenvs/v_python3.6/include/site/python3.6/psutil" failed with error code 1 in /tmp/pip-build-dzgqgruh/psutil/

缺少Python.h

1
2
3
4
5
6
7
8
9
10
htf@linux-rzt3: ~ > sudo zypper install python3-devel
(v_python3.6) htf@linux-rzt3:~/PycharmProjects/python3.6/ServiceConnectEvolution> pip install psutil
Collecting psutil
Using cached psutil-5.3.0.tar.gz
Building wheels for collected packages: psutil
Running setup.py bdist_wheel for psutil ... done
Stored in directory: /home/htf/.cache/pip/wheels/ba/1d/54/5954c0b7822f7135fe793c08aadc423513bda607782235e33f
Successfully built psutil
Installing collected packages: psutil
Successfully installed psutil-5.3.0

pip_require_tls_ssl问题

发表于 2017-09-05 | 更新于: 2019-11-08   |   更新于 2019-11-08

salt推送报pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cmd_|-python_requirements_|-/usr/local/_python3.6.1/bin/pip3 install -r sce_requirements.txt_|-run:
----------
__run_num__:
5
changes:
----------
pid:
26431
retcode:
1
stderr:
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not find a version that satisfies the requirement psutil==5.3.0 (from -r sce_requirements.txt (line 1)) (from versions: )
No matching distribution found for psutil==5.3.0 (from -r sce_requirements.txt (line 1))
stdout:
Collecting psutil==5.3.0 (from -r sce_requirements.txt (line 1))
Could not fetch URL https://pypi.python.org/simple/psutil/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
comment:
Command "/usr/local/_python3.6.1/bin/pip3 install -r sce_requirements.txt" run
duration:
514.995
name:
/usr/local/_python3.6.1/bin/pip3 install -r sce_requirements.txt
result:
False
start_time:
20:13:40.393491

应该是openssl相关的包有问题

1
2
[root@192_168_1_1 bin]# rpm -qa |grep openssl
openssl-1.0.1e-57.el6.x86_64

没有devel包

1
# yum install -y openssl-devel

minikube安装试用

发表于 2017-09-03 | 更新于: 2019-11-08   |   更新于 2019-11-08

下载kubernetes源码包

1
2
3
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# yum install unzip wget
[root@localhost src]# wget https://github.com/kubernetes/kubernetes/archive/v1.7.5.zip

elasticsearch_request_time_collect

发表于 2017-08-19 | 更新于: 2019-11-08   |   更新于 2019-11-08

elasticsearch_request_time_collect

https://github.com/talenhao/elasticsearch_request_time_collect

收集es中指定索引中的所有request_time及request字段,并处理成报表.

elasticsearch_request_time_collect脚本使用说明

激活python环境

source /virtual_python3.6.1/bin/activate

用法:

1
2
3
4
5
6
7
8
9
/elasticsearch_request_time_collect.py [--命令选项] [参数]

命令选项:
--help, -H 帮助
--version, -V 输出版本号
--index-regex -i 索引,支持正则 eg:in.access.log
--date, -d 收集的日期 eg:2017.08.16
--es-ip -h Elasticsearch IP地址
--es-port -p Elasticsearch 端口

默认参数为:

1
2
3
4
5
# default args
es_host = "192.168.1.1"
es_port = '9200'
search_date = today
index_regex = "*access.log"

eg:

1
2
3
4
5
6
7
8
9
10
time python elasticsearch_request_time_collect.py -i *access.log -d 2017.08.16 -h 192.168.1.1

...
api: '/adfafaf/sfdaf'
api: '/client/timeline/hadfasfafafasf'
api: '/client/adfasfsafasfasfasfaf'

real 0m32.262s
user 0m25.998s
sys 0m1.919s

rundeck日报发送脚本

发表于 2017-08-19 | 更新于: 2019-11-08   |   更新于 2019-11-08

RundeckJobResult


rundeck 日报发送脚本使用指南

  • 收集rundeck任务运行结果并做个报表,日报,发送邮件给指定联系人.*

source ~/.virtualenvs/rundeck3.6/bin/activate

usage

1
2
3
4
5
6
7
8
9
10
11
12
13

用法:
RdJobResult.py [--命令选项] [参数]

命令选项:

--help, -h 帮助。

--version, -V 输出版本号。

--mailaddr, -m 用户名@邮件域名,用户名@邮件域名,... 接收邮件的地址。

eg: python3.6 rundeck_job_status.py -m talenhao@gmail.com,talenhao2@gmail.com,...

log文件

/tmp/rundeck_job_status.py.log.${date},${hour.min}

eg: /tmp/rundeck_job_status.py.log.2017-06-27,16.22

在rundeck上做成一个job

每日23:59分执行
image

邮件内容

image


订阅 说明
常规订阅: 如果需要添加日报订阅者,直接rundeck_result.start任务,option上添加订阅者邮箱即可,使用”,”号分割。
临时订阅: 如果是临时订阅,在任务运行界面mailto参数上点击”New Value”,输入订阅者邮件地址。
1…910

天飞

95 日志
41 分类
79 标签
RSS
GitHub E-Mail
Links
  • 天飞的博客
© 2017 — 2020 天飞
由 Hexo 强力驱动
|
主题 — NexT.Gemini v5.1.4
本站访客数 人次 本站总访问量 次