python3.6安装memory_profiler,,1. 在centos
python3.6安装memory_profiler,,1. 在centos
1. 在centos中安装memory_profiler
pip3 install memory_profiler
报了个错:
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 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=570 -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:20: fatal error: Python.h: No such file or directory #include <Python.h> ^ compilation terminated. error: command ‘gcc‘ failed with exit status 1 ----------------------------------------Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__=‘/tmp/pip-build-ctdkmofk/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-nuiv1vvh-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ctdkmofk/psutil/
解决方式:
sudo yum install python3-devel
2.重新安装memory_profiler
pip3 install memory_profiler
输出如下:
Collecting memory_profiler Downloading http://mirrors.tencentyun.com/pypi/packages/f4/03/175d380294b2333b9b79c2f2aa235eb90ee95e3ddef644497a9455404312/memory_profiler-0.57.0.tar.gzCollecting psutil (from memory_profiler) Downloading http://mirrors.tencentyun.com/pypi/packages/c4/b8/3512f0e93e0db23a71d82485ba256071ebef99b227351f0f5540f744af41/psutil-5.7.0.tar.gz (449kB) 100% |████████████████████████████████| 450kB 1.5MB/sInstalling collected packages: psutil, memory-profiler Running setup.py install for psutil ... done Running setup.py install for memory-profiler ... doneSuccessfully installed memory-profiler-0.57.0 psutil-5.7.0
ok. 成功!记一下备忘。
python3.6安装memory_profiler
相关内容
- KaliLinux切换python版本,python版本切换,一、 打开终端分
- python之turtle画蚊香,python用turtle画圆弧,原理:利用tu
- Python爬取网页全代码,python爬虫万能代码,#爬取京东全
- 记一次在termux上部署python+uiautomator2实现手机上直接跑代
- Python的Request模块,请求跳过认证及禁用警告,,最近在
- Python对JSON数据的解析,什么是大数据分析,1.python与j
- Google Authenticator TOTP原理详解(以Python为例),手摇发电机
- Python 绝对路径添加,相对路径和绝对路径举例,import
- 小白python爬虫之路——构造URL集,python爬虫接单网,例某
- Python备份H3C交换机配置并上传到tftp,,实验环境:cent
评论关闭