Linux 下通过 pip3 安装 Ansible
Posted wst021sh
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux 下通过 pip3 安装 Ansible相关的知识,希望对你有一定的参考价值。
系统平台
[scm@192 ~]$ uname -a
Linux 192.168.109.139 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[scm@192 ~]$
[scm@192 ~]$ cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
[scm@192 ~]$
[scm@192 ~]$
执行上面的两条指令后,可以看到我当前的系统是 CentOS 7.9 系统平台。
系统更新
今天主要是安装 Ansible 工具,Ansible 是一个配置管理和自动化运维工具,是基于 Python 开发,那系统前提也必须要有 Python 工具环境,才能去执行安装。执行安装之前,还是老规矩先更新系统,执行如下指令:
系统更新完成,显示结果如下:
Install 2 Packages
Upgrade 236 Packages
Remove 1 Package
执行安装
下面接着安装 python-pip ,执行指令如下:
[root@192 scm]#
[root@192 scm]# yum install -y python-pip
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* epel: mirror.sjtu.edu.cn
* extras: mirrors.njupt.edu.cn
* updates: mirrors.njupt.edu.cn
Package python2-pip-8.1.2-14.el7.noarch already installed and latest version
Nothing to do
[root@192 scm]#
[root@192 scm]#
可以看到直接安装 python-pip 显示 noarch already installed and latest version 是因为缺少了 epel 扩展源,需要先安装这个源再接着安装。
[root@192 scm]
[root@192 scm] yum -y install epel-release
Loaded plugins: fastestmirror, langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* epel: mirror.sjtu.edu.cn
* extras: mirrors.njupt.edu.cn
* updates: mirrors.njupt.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-13 will be updated
---> Package epel-release.noarch 0:7-14 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================================
Updating:
epel-release noarch 7-14 epel 15 k
Transaction Summary
==========================================Ansible virtualenv下pip3安装requirements报错