Python系統(tǒng)性能信息模塊psutil安裝報(bào)錯(cuò)解決一例-創(chuàng)新互聯(lián)

今天在執(zhí)行python腳本時(shí)報(bào)如下錯(cuò)誤:
[root@localhost ~]# python mysql_watcher.py -p dbset.ini
Traceback (most recent call last):
  File "mysql_watcher.py", line 17, in <module>
    import psutil
ImportError: No module named psutil
經(jīng)查詢,psutil是python的系統(tǒng)性能信息模塊,正確的安裝方法如下:
[root@localhost ~]# yum install python-setuptools
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.bit.edu.cn
 * extras: mirrors.btte.net
 * updates: mirror.bit.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package python-setuptools.noarch 0:0.6.10-3.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================================================
 Package                                     Arch                             Version                                   Repository                      Size
=============================================================================================================================================================
Installing:
 python-setuptools                           noarch                           0.6.10-3.el6                              base                           336 k
Transaction Summary
=============================================================================================================================================================
Install       1 Package(s)
Total download size: 336 k
Installed size: 1.5 M
Is this ok [y/N]: y
Downloading Packages:
python-setuptools-0.6.10-3.el6.noarch.rpm                                                                                             | 336 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : python-setuptools-0.6.10-3.el6.noarch                                                                                                     1/1
  Verifying  : python-setuptools-0.6.10-3.el6.noarch                                                                                                     1/1
Installed:
  python-setuptools.noarch 0:0.6.10-3.el6
Complete!
[root@localhost ~]# easy_install psutil
Searching for psutil
Reading http://pypi.python.org/simple/psutil/
Best match: psutil 5.2.2
Downloading /tupian/20230522/psutil-5.2.2.tar.gz /> Processing psutil-5.2.2.tar.gz
Running psutil-5.2.2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-aRZwy3/psutil-5.2.2/egg-dist-tmp-EDoxRo
warning: manifest_maker: MANIFEST.in, line 14: 'recursive-include' expects <dir> <pattern1> <pattern2> ...
warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no previously-included files matching '*' found under directory '.ci'
psutil/_psutil_linux.c: In function ‘psutil_proc_cpu_affinity_set’:
psutil/_psutil_linux.c:426: warning: suggest explicit braces to avoid ambiguous ‘else’
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:630: warning: unused variable ‘v’
Adding psutil 5.2.2 to easy-install.pth file
Installed /usr/lib/python2.6/site-packages/psutil-5.2.2-py2.6-linux-x86_64.egg
Processing dependencies for psutil
Finished processing dependencies for psutil

當(dāng)前文章:Python系統(tǒng)性能信息模塊psutil安裝報(bào)錯(cuò)解決一例-創(chuàng)新互聯(lián)
本文路徑:http://muchs.cn/article38/deigpp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站排名服務(wù)器托管、網(wǎng)站建設(shè)、網(wǎng)站維護(hù)、品牌網(wǎng)站設(shè)計(jì)網(wǎng)站內(nèi)鏈

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

成都做網(wǎng)站