centos 7 使用pip添加paramiko模块

pip用来管理python包很方便,如下安装pip,添加 paramiko:

[root@localhost ~]# cat /etc/redhat-release 
CentOS Linux release 7.6.1810 (Core) 

(1)首先需要安装epel-release拓展源(改到国内阿里源),安装基础包

[root@localhost ~]# yum -y install epel-release
[root@localhost ~]# mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
[root@localhost ~]# mv /etc/yum.repos.d/epel-testing.repo /etc/yum.repos.d/epel-testing.repo.backup
[root@localhost ~]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
[root@localhost ~]# yum -y install gcc
[root@localhost ~]# yum -y install pycrypto

(2)安装pip

[root@localhost ~]# yum -y install python-pip

(3)升级pip

[root@localhost ~]# pip install --upgrade pip
Collecting pip
  Downloading https://files.pythonhosted.org/packages/43/84/23ed6a1796480a6f1a2d38f2802901d078266bda38388954d01d3f2e821d/pip-20.1.1-py2.py3-none-any.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 219kB/s 
Installing collected packages: pip
  Found existing installation: pip 8.1.2
    Uninstalling pip-8.1.2:
      Successfully uninstalled pip-8.1.2
Successfully installed pip-20.1.1

(4) 添加paramiko模块

[root@localhost ~]# pip2.7 install paramiko
DEPRECATION: 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
Collecting paramiko
  Downloading paramiko-2.7.1-py2.py3-none-any.whl (206 kB)
     |████████████████████████████████| 206 kB 71 kB/s 
Collecting bcrypt>=3.1.3
  Downloading bcrypt-3.1.7-cp27-cp27mu-manylinux1_x86_64.whl (59 kB)
     |████████████████████████████████| 59 kB 74 kB/s 
Collecting pynacl>=1.0.1
  Downloading PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl (964 kB)
     |████████████████████████████████| 964 kB 43 kB/s 
Collecting cryptography>=2.5
  Downloading cryptography-2.9.2-cp27-cp27mu-manylinux2010_x86_64.whl (2.7 MB)
     |████████████████████████████████| 2.7 MB 24 kB/s 
Collecting six>=1.4.1
  Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting cffi>=1.1
  Downloading cffi-1.14.0-cp27-cp27mu-manylinux1_x86_64.whl (387 kB)
     |████████████████████████████████| 387 kB 58 kB/s 
Requirement already satisfied: ipaddress; python_version < "3" in /usr/lib/python2.7/site-packages (from cryptography>=2.5->paramiko) (1.0.16)
Collecting enum34; python_version < "3"
  Downloading enum34-1.1.10-py2-none-any.whl (11 kB)
Collecting pycparser
  Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
     |████████████████████████████████| 112 kB 74 kB/s 
Installing collected packages: six, pycparser, cffi, bcrypt, pynacl, enum34, cryptography, paramiko
Successfully installed bcrypt-3.1.7 cffi-1.14.0 cryptography-2.9.2 enum34-1.1.10 paramiko-2.7.1 pycparser-2.20 pynacl-1.4.0 six-1.15.0

结束

posted @ 2020-06-21 16:20  Ant·Hanks  阅读(241)  评论(0)    收藏  举报