当前位置:首页 > python > 正文内容

centos7 python2安装psutil

root4年前 (2020-12-14)python1664
[root@internet geo_server]# pip install psutilDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.Collecting psutil
  Using cached psutil-5.7.3.tar.gz (465 kB)
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-2gS0Bh/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-2gS0Bh/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-xS1cva
         cwd: /tmp/pip-install-2gS0Bh/psutil/
    Complete output (5 lines):
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'long_description_content_type'
      warnings.warn(msg)
    error in psutil setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.[root@internet geo_server]# [root@internet geo_server]# pip install --upgrade setuptoolsDEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.Collecting setuptools
  Downloading setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
     |████████████████████████████████| 583 kB 287 kB/s 
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 0.9.8
    Uninstalling setuptools-0.9.8:
      Successfully uninstalled setuptools-0.9.8
Successfully installed setuptools-44.1.1[root@internet geo_server]#[root@internet geo_server]# pip install psutil==5.7.3DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.Collecting psutil==5.7.3
  Using cached psutil-5.7.3.tar.gz (465 kB)Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Installing collected packages: psutil
    Running setup.py install for psutil ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Ra96ci/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Ra96ci/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-record-K2AJo1/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python2.7/psutil
         cwd: /tmp/pip-install-Ra96ci/psutil/
    Complete output (45 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psaix.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pslinux.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
    creating build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_system.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_testutils.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_memleaks.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_osx.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-x86_64-2.7/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/psutil
    gcc -pthread -fno-strict-aliasing -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 -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=573 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/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
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-Ra96ci/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-Ra96ci/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-record-K2AJo1/install-record.txt --single-version-externally-managed --compile --install-headers /usr/include/python2.7/psutil Check the logs for full command output.[root@internet geo_server]# [root@internet geo_server]# yum install python2-develLoaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package python-devel.x86_64 0:2.7.5-90.el7 will be installed
--> Processing Dependency: python(x86-64) = 2.7.5-90.el7 for package: python-devel-2.7.5-90.el7.x86_64
--> Processing Dependency: python2-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64
--> Processing Dependency: python-rpm-macros > 3-30 for package: python-devel-2.7.5-90.el7.x86_64
--> Running transaction check
---> Package python.x86_64 0:2.7.5-89.el7 will be updated
---> Package python.x86_64 0:2.7.5-90.el7 will be an update
--> Processing Dependency: python-libs(x86-64) = 2.7.5-90.el7 for package: python-2.7.5-90.el7.x86_64
---> Package python-rpm-macros.noarch 0:3-34.el7 will be installed
--> Processing Dependency: python-srpm-macros for package: python-rpm-macros-3-34.el7.noarch
---> Package python2-rpm-macros.noarch 0:3-34.el7 will be installed
--> Running transaction check
---> Package python-libs.x86_64 0:2.7.5-89.el7 will be updated
---> Package python-libs.x86_64 0:2.7.5-90.el7 will be an update
---> Package python-srpm-macros.noarch 0:3-34.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved==============================================================================================================================================================================
 Package                                          Arch                                 Version                                    Repository                             Size==============================================================================================================================================================================Installing:
 python-devel                                     x86_64                               2.7.5-90.el7                               updates                               399 k
Installing for dependencies:
 python-rpm-macros                                noarch                               3-34.el7                                   base                                  9.1 k
 python-srpm-macros                               noarch                               3-34.el7                                   base                                  8.8 k
 python2-rpm-macros                               noarch                               3-34.el7                                   base                                  8.1 k
Updating for dependencies:
 python                                           x86_64                               2.7.5-90.el7                               updates                                96 k
 python-libs                                      x86_64                               2.7.5-90.el7                               updates                               5.6 M

Transaction Summary==============================================================================================================================================================================Install  1 Package  (+3 Dependent packages)Upgrade             ( 2 Dependent packages)Total download size: 6.2 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.(1/6): python-2.7.5-90.el7.x86_64.rpm                                                                                                                  |  96 kB  00:00:00     
(2/6): python-srpm-macros-3-34.el7.noarch.rpm                                                                                                          | 8.8 kB  00:00:00     
(3/6): python-rpm-macros-3-34.el7.noarch.rpm                                                                                                           | 9.1 kB  00:00:00     
(4/6): python2-rpm-macros-3-34.el7.noarch.rpm                                                                                                          | 8.1 kB  00:00:00     
(5/6): python-devel-2.7.5-90.el7.x86_64.rpm                                                                                                            | 399 kB  00:00:00     
(6/6): python-libs-2.7.5-90.el7.x86_64.rpm                                                                                                             | 5.6 MB  00:00:00     
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                         6.6 MB/s | 6.2 MB  00:00:00     
Running transaction check
Running transaction testTransaction test succeeded
Running transaction
  Updating   : python-libs-2.7.5-90.el7.x86_64                                                                                                                            1/8 
  Updating   : python-2.7.5-90.el7.x86_64                                                                                                                                 2/8 
  Installing : python-srpm-macros-3-34.el7.noarch                                                                                                                         3/8 
  Installing : python-rpm-macros-3-34.el7.noarch                                                                                                                          4/8 
  Installing : python2-rpm-macros-3-34.el7.noarch                                                                                                                         5/8 
  Installing : python-devel-2.7.5-90.el7.x86_64                                                                                                                           6/8 
  Cleanup    : python-2.7.5-89.el7.x86_64                                                                                                                                 7/8 
  Cleanup    : python-libs-2.7.5-89.el7.x86_64                                                                                                                            8/8 
  Verifying  : python2-rpm-macros-3-34.el7.noarch                                                                                                                         1/8 
  Verifying  : python-libs-2.7.5-90.el7.x86_64                                                                                                                            2/8 
  Verifying  : python-devel-2.7.5-90.el7.x86_64                                                                                                                           3/8 
  Verifying  : python-2.7.5-90.el7.x86_64                                                                                                                                 4/8 
  Verifying  : python-rpm-macros-3-34.el7.noarch                                                                                                                          5/8 
  Verifying  : python-srpm-macros-3-34.el7.noarch                                                                                                                         6/8 
  Verifying  : python-libs-2.7.5-89.el7.x86_64                                                                                                                            7/8 
  Verifying  : python-2.7.5-89.el7.x86_64                                                                                                                                 8/8 

Installed:
  python-devel.x86_64 0:2.7.5-90.el7                                                                                                                                          

Dependency Installed:
  python-rpm-macros.noarch 0:3-34.el7                      python-srpm-macros.noarch 0:3-34.el7                      python2-rpm-macros.noarch 0:3-34.el7                     

Dependency Updated:
  python.x86_64 0:2.7.5-90.el7                                                        python-libs.x86_64 0:2.7.5-90.el7                                                       

Complete![root@internet geo_server]# [root@internet geo_server]# pip install psutil==5.7.3DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.Collecting psutil==5.7.3
  Using cached psutil-5.7.3.tar.gz (465 kB)Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Installing collected packages: psutil
    Running setup.py install for psutil ... doneSuccessfully installed psutil-5.7.3[root@internet geo_server]#------------------------------------
yum install python-dev

centos安装 python-dev包提示No package python-dev available:
出现此问题的原因是python-dev的包在centos的yum中不叫python-dev,而是python-devel.
所以使用下面的命令即可安装python-dev:

yum install python-devel

原文

扫描二维码推送至手机访问。

版权声明:本文由一叶知秋发布,如需转载请注明出处。

本文链接:https://zhiqiu.top/?id=64

分享给朋友:

相关文章

python 发送和发送ICMP数据包

python 发送和发送ICMP数据包

ICMP协议在实际传输中数据包:20字节IP首部 + 8字节ICMP首部+ 1472字节<数据大小>38字节。对于ICMP首部细分为8位类型+8位代码+16位校验和+16位标识符+16位序列号其中类型的取值如下,我们比较关注的是...

python进行远程ssh连接的pexpect模块

from pexpect import pxssh s=pxssh.pxssh() s.login(host, user, password) s.sendline(cmd) s.p...

python 的configparser 读取配置文件遇到%特殊符号

test.ini 配置文件中有mysql的密码,且密码含有“%”这个特殊符号因为%在py是转义符的含义需要对该字符转义即修改  %  为 %%用%对%进行转义...

自定义logger 模块使调用打印日志的文件为调用文件而不是logger模块

更新logging 源码1248行f f f.f_back替换为f f f.f_back     f_2 f.f_back   ...

python 环境变量 conda 包管理 virtualenv 工具

conda 环境conda -h 查看帮助conda env list 查看所有虚拟环境deactivate 退出虚拟环境activate  环境名  进入虚拟环境virtualenv  环境workon&nb...

pip 升级到指定版本,但是py2的pip版本务必在20版本以内包含20版本

python3 -m pip install --user --upgrade pip==9.0.3(换成你想要的版本编号)如果python2的只能升级到20+版本。超过会出现不支持的情况...