安裝psutil模組報錯的解決方法
psutil/_psutil_linux.c:190: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_linux.c:240: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_linux.c:268: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_linux.c:375: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_linux.c:433: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_linux.c:482: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
psutil/_psutil_linux.c:543: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'PsutilMethods'
psutil/_psutil_linux.c:582: error: expected specifier-qualifier-list before 'PyObject'
psutil/_psutil_linux.c: In function 'init_psutil_linux':
psutil/_psutil_linux.c:628: error: 'PyObject' undeclared (first use in this function)
psutil/_psutil_linux.c:628: error: (Each undeclared identifier is reported only once
psutil/_psutil_linux.c:628: error: for each function it appears in.)
psutil/_psutil_linux.c:628: error: 'v' undeclared (first use in this function)
psutil/_psutil_linux.c:632: error: 'module' undeclared (first use in this function)
psutil/_psutil_linux.c:632: warning: implicit declaration of function 'Py_InitModule'
psutil/_psutil_linux.c:632: error: 'PsutilMethods' undeclared (first use in this function)
psutil/_psutil_linux.c:635: warning: implicit declaration of function 'PyModule_AddIntConstant'
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-cY1TLx/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-J4cL69-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-cY1TLx/psutil/
===============================================================
解決方法是安裝python-devel,這是Python的標頭檔案和靜態庫包:
[root@localhost ~]# yum install python-devel.x86_64
Failed to set locale, defaulting to C
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-devel.x86_64 0:2.6.6-51.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
===============================================================================================
Package Arch Version Repository Size
===============================================================================================
Installing:
python-devel x86_64 2.6.6-51.el6 cdrom-server 171 k
Transaction Summary
===============================================================================================
Install 1 Package(s)
Total download size: 171 k
Installed size: 456 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : python-devel-2.6.6-51.el6.x86_64 1/1
Verifying : python-devel-2.6.6-51.el6.x86_64 1/1
Installed:
python-devel.x86_64 0:2.6.6-51.el6
Complete!
在用pip安裝psutil模組
[root@localhost ~]# pip install psutil
DEPRECATION: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of pip will drop support for Python 2.6
Collecting psutil
Using cached psutil-5.0.1.tar.gz
Installing collected packages: psutil
Running setup.py install for psutil ... done
Successfully installed psutil-5.0.1
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29065182/viewspace-2132875/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Python系統效能資訊模組psutil安裝報錯解決一例Python
- kaldi的編譯安裝與報錯解決方法編譯
- 安裝ionic 報錯 安裝canvas報錯 解決辦法Canvas
- psutil模組詳解
- 安裝sass報錯解決方案
- 解決fitz模組報錯
- Nodejs的npm安裝模組時候報錯:npm ERR! Error: CERT_UNTRUSTED的解決方法NodeJSNPMErrorRust
- Laravel安裝horizon報錯解決方案Laravel
- mac Pro 安裝scrapy報錯解決Mac
- win安裝wordcloud報錯解決方案Cloud
- ceph叢集安裝報錯解決方法
- 使用pip安裝selenium庫一直報錯的解決方法
- CentOS 6.5編譯安裝IPVS 1.26報錯的解決方法CentOS編譯
- Windows 環境安裝 Horizon 報錯解決Windows
- npm install 安裝報錯解決方案NPM
- linux 安裝 jupyter報錯解決Linux
- CentOS 6安裝Oracle報錯解決方案CentOSOracle
- LR9.10安裝報錯解決
- 搬瓦工VPS安裝銳速加速軟體報錯的解決方法
- docker中安裝tcpdump出錯解決方法DockerTCP
- nginx安裝擴充套件模組報錯Nginx套件
- 安裝sysbench過程報錯,解決辦法
- 一個安裝rpm格式軟體報錯問題的解決方法(轉)
- 轉發 安裝 scount 的 es 驅動,報錯解決
- Perl CPAN安裝報錯CPAN::Modulelist的解決辦法
- 幾個報錯的解決方法
- Win10安裝msi程式報錯怎麼辦?Win10安裝msi程式報2503和2502錯誤的解決方法Win10
- 【Python】pip安裝scrapy、mysqlclient出錯的解決方法PythonMySqlclient
- centos7騰訊雲uwsgi安裝報錯解決CentOS
- 【安裝Android Studio報錯之解決方案】Android
- vm安裝ubuntu後,update報錯問題解決Ubuntu
- 【轉】RAC安裝時,報The specified nodes are not clusterable 的解決方法
- Linux系統yum安裝報錯Cannot find a valid baseurl for repo的解決方法Linux
- hive使用報錯解決方法Hive
- 關於npm install安裝報錯的解決辦法NPM
- 關於安裝 node-Sass 報錯的解決記錄
- Python: 安裝 sklearn 包出現錯誤的解決方法Python
- 11G安裝時報SEVERE: [FATAL] 錯誤的解決方法