linux下安装easy_install、pip和psutil模块

简介: 1.上传软件setuptools-25.2.0.tar.gz   tar xvf setuptools-25.2.0.tar.gz    //解压软件lscd setuptools-25.2.0 //进入目录进入目录python setup.

1.上传软件setuptools-25.2.0.tar.gz

   tar xvf setuptools-25.2.0.tar.gz    //解压软件

ls
cd setuptools-25.2.0             //进入目录进入目录
python setup.py install      //安装软件 
easy_install pip          //安装pip安装工具
pip install psutil         //安装psutil模块,psutil模块可以统计系统的cpu 内存和硬盘以及网络统计等等
 
系统报错如下报错:
running install
running bdist_egg
......
psutil/_psutil_linux.c:12:20: error: Python.h: No such file or directory
In file included from psutil/_psutil_linux.c:23:
psutil/_psutil_linux.h:11: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
......
psutil/_psutil_linux.h:20: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
psutil/_psutil_linux.c: In function ‘ioprio_get’:
psutil/_psutil_linux.c:50: warning: implicit declaration of function ‘syscall’
psutil/_psutil_linux.c: At top level:
psutil/_psutil_linux.c:70: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
......
psutil/_psutil_linux.c:384: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PsutilMethods’
psutil/_psutil_linux.c:421: error: expected specifier-qualifier-list before ‘PyObject’
psutil/_psutil_linux.c: In function ‘init_psutil_linux’:
psutil/_psutil_linux.c:470: error: ‘PyObject’ undeclared (first use in this function)
psutil/_psutil_linux.c:470: error: (Each undeclared identifier is reported only once
psutil/_psutil_linux.c:470: error: for each function it appears in.)
psutil/_psutil_linux.c:470: error: ‘module’ undeclared (first use in this function)
psutil/_psutil_linux.c:470: warning: implicit declaration of function ‘Py_InitModule’
psutil/_psutil_linux.c:470: error: ‘PsutilMethods’ undeclared (first use in this function)
error: command ‘gcc‘ failed with exit status 1
 
解决方法:
error: command ‘gcc‘ failed with exit status 1

安装 yum install gcc -y
安装 yum install python-devel -y
重新安装 pip install psutil 成功了ok


目录
相关文章
|
16天前
|
Ubuntu Linux 开发工具
深入探索Linux内核模块编程
【8月更文挑战第4天】在这篇文章中,我们不仅将探讨Linux内核模块的基础知识,还将通过一个实际的例子来展示如何编写一个简单的内核模块。我们将从理论出发,逐步过渡到动手实践,最终实现一个可以在Linux系统上运行的模块。文章的目标是为读者提供足够的信息和知识,以便他们能够自己编写内核模块,从而对操作系统的内部工作原理有更深入的了解。
|
18天前
pip安装iterstrat.ml_stratifiers import MultilabelStratifiedKFold, MultilabelStratifiedShuffleSplit
文章介绍了如何使用iterative-stratification库进行多标签多分类的K折交叉验证,包括安装方法和示例代码。
11 1
|
5天前
|
存储 Linux 网络安全
常用的 Python 工具:使用 virtualenv、使用 Pip 进行安装和管理包
常用的 Python 工具:使用 virtualenv、使用 Pip 进行安装和管理包
7 0
|
5天前
|
Python
Python——pip安装weditor失败
Python——pip安装weditor失败
14 0
|
1月前
|
Web App开发 测试技术 Shell
确保您已经安装了Selenium和ChromeDriver。您可以使用pip来安装Selenium:
确保您已经安装了Selenium和ChromeDriver。您可以使用pip来安装Selenium:
|
1月前
|
SQL Python
你需要在你的系统上安装`sqlmap`。这通常可以通过下载其源代码并编译,或者使用包管理器(如`apt`、`yum`或`pip`,但请注意,`pip`通常不直接提供`sqlmap`)来完成。
你需要在你的系统上安装`sqlmap`。这通常可以通过下载其源代码并编译,或者使用包管理器(如`apt`、`yum`或`pip`,但请注意,`pip`通常不直接提供`sqlmap`)来完成。
|
1月前
|
Python
确保你已经安装了`dronekit`库。如果没有,你可以使用pip来安装:
确保你已经安装了`dronekit`库。如果没有,你可以使用pip来安装:
|
12天前
|
Linux Python
解决Linux服务器中pip安装包后,能使用pip show packageName 却不能import
本文讨论了在Linux服务器中使用pip安装Python包后,通过pip show命令能查看包信息但无法import的问题,并提供了两种解决方法:一是解决因用户权限不一致导致的问题,二是解决因Python环境版本不匹配导致的问题。
22 0
|
1月前
|
开发框架 机器人 .NET
我们需要安装`pybullet`模块,这可以通过pip来完成:
我们需要安装`pybullet`模块,这可以通过pip来完成:
|
1月前
|
开发者 Python
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装:
确保你的Python环境中已经安装了`python-docx`模块。如果还没有安装,可以通过pip来安装: