#### 本章主要介绍在linux系统环境下,银河在线方式安装pip(包管理工具)和paramiko#####
######### 1. pip和pip3下载get-pip.py的麒麟地址

https://bootstrap.pypa.io/pip/2.7/get-pip.py
https://bootstrap.pypa.io/pip/3.7/get-pip.py
######### 2.在线安装pip
## 2.1 创建存放目录
[root@test ~]# mkdir -p /Package/python_package/python_pip-2.7
[root@test ~]# mkdir -p /Package/python_package/python_pip-3.7
## 2.2 在线下载python2.7版本的get-pip.py
[root@test ~]# wget https://bootstrap.pypa.io/pip/2.7/get-pip.py -P /Package/python_package/python_pip-2.7
--2024-07-24 15:37:59-- https://bootstrap.pypa.io/pip/2.7/get-pip.py
正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.188.175, 2a04:4e42:2d::175
正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|151.101.188.175|:443... 已连接。
已发出 HTTP 请求 ,系统线安正在等待回应... 200 OK
长度:1908226 (1.8M) [text/x-python]
正在保存至: “
/Package/python_package/python_pip-2.7/get-pip.py”get-pip.py 100%[=============================================================================================================>] 1.82M 702KB/s 用时 2.7s
2024-07-24 15:38:04 (702 KB/s) - 已保存 “
/Package/python_package/python_pip-2.7/get-pip.py” [1908226/1908226])## 2.3 在线下载python3.7版本的银河get-pip.py
[root@test ~]# wget https://bootstrap.pypa.io/pip/3.7/get-pip.py -P /Package/python_package/python_pip-3.7
--2024-07-24 15:40:11-- https://bootstrap.pypa.io/pip/3.7/get-pip.py
正在解析主机 bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.188.175, 2a04:4e42:4b::175
正在连接 bootstrap.pypa.io (bootstrap.pypa.io)|151.101.188.175|:443... 已连接 。
已发出 HTTP 请求,麒麟快手点赞自助平台有哪些正在等待回应... 200 OK
长度 :2635841 (2.5M) [text/x-python]
正在保存至: “
/Package/python_package/python_pip-3.7/get-pip.py”get-pip.py 100%[=============================================================================================================>] 2.51M 177KB/s 用时 14s
2024-07-24 15:40:27 (184 KB/s) - 已保存 “
/Package/python_package/python_pip-3.7/get-pip.py” [2635841/2635841])## 2.4安装python2.7版本的系统线安24小时点赞自助服务pip
# 进入get-pip目录
[root@test ~]# cd /Package/python_package/python_pip-2.7
# 确认python的版本
[root@test python_pip-2.7]# /usr/bin/python -V
Python 2.7.18
# 安装pip
[root@test python_pip-2.7]# /usr/bin/python get-pip.py
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 pip 21.0 will remove support for this functionality.
Collecting pip<21.0
Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB)
|████████████████████████████████| 1.5 MB 3.2 MB/s
Collecting wheel
Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, wheel
Successfully installed pip-20.3.4 wheel-0.37.1
# 确认pip的路径
[root@test python_pip-2.7]# whereis pip
pip: /usr/bin/pip /usr/bin/pip2.7
# 查看pip版本
[root@test python_pip-2.7]# /usr/bin/pip -V
pip 20.3.4 from /usr/lib/python2.7/site-packages/pip (python 2.7)
# python2.7版本的pip安装paramiko模块
[root@test ~]# /usr/bin/pip 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 pip 21.0 will remove support for this functionality.
Collecting paramiko
Downloading paramiko-2.12.0-py2.py3-none-any.whl (213 kB)
|████████████████████████████████| 213 kB 197 kB/s
Collecting bcrypt>=3.1.3
Downloading bcrypt-3.1.7-cp27-cp27mu-manylinux1_x86_64.whl (59 kB)
|████████████████████████████████| 59 kB 1.8 MB/s
Requirement already satisfied: six in /usr/lib/python2.7/site-packages (from paramiko) (1.15.0)
Collecting pynacl>=1.0.1
Downloading PyNaCl-1.4.0-cp27-cp27mu-manylinux1_x86_64.whl (964 kB)
|████████████████████████████████| 964 kB 1.7 MB/s
Collecting cryptography>=2.5
Downloading cryptography-3.3.2-cp27-cp27mu-manylinux2010_x86_64.whl (2.6 MB)
|████████████████████████████████| 2.6 MB 231 kB/s
Collecting cffi>=1.1
Downloading cffi-1.15.1-cp27-cp27mu-manylinux1_x86_64.whl (390 kB)
|████████████████████████████████| 390 kB 675 kB/s
Collecting ipaddress; python_version < "3"
Downloading ipaddress-1.0.23-py2.py3-none-any.whl (18 kB)
Collecting enum34; python_version < "3"
Downloading enum34-1.1.10-py2-none-any.whl (11 kB)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Installing collected packages: pycparser, cffi, bcrypt, pynacl, ipaddress, enum34, cryptography, paramiko
Successfully installed bcrypt-3.1.7 cffi-1.15.1 cryptography-3.3.2 enum34-1.1.10 ipaddress-1.0.23 paramiko-2.12.0 pycparser-2.21 pynacl-1.4.0
## 2.5安装python3.7版本的pip
# 进入get-pip目录
[root@test ~]# cd /Package/python_package/python_pip-3.7
# 确认python的版本
[root@test ~]# /usr/bin/python3.7 -V
Python 3.7.9
# 安装pip
[root@test ~]# /usr/bin/python3.7 get-pip.py
Collecting pip<24.1
Downloading pip-24.0-py3-none-any.whl.metadata (3.6 kB)
Collecting wheel
Downloading wheel-0.42.0-py3-none-any.whl.metadata (2.2 kB)
Downloading pip-24.0-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 1.3 MB/s eta 0:00:00
Downloading wheel-0.42.0-py3-none-any.whl (65 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.4/65.4 kB 3.5 MB/s eta 0:00:00
DEPRECATION: targetcli-fb 2.1.fb48 has a non-standard version number. pip 24.1 will enforce this behaviour change. A possible replacement is to upgrade to a newer version of targetcli-fb or contact the author to suggest that they release a version with a conforming version number. Discussion can be found at https://github.com/pypa/pip/issues/12063
Installing collected packages: wheel, pip
Successfully installed pip-24.0 wheel-0.42.0
WARNING: Running pip as the root user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
# 确认pip的路径
[root@test ~]# whereis pip
pip: /usr/bin/pip /usr/bin/pip2.7 /usr/local/bin/pip /usr/local/bin/pip3.7
# 查看pip版本
[root@test ~]# /usr/local/bin/pip3 -V
pip 24.0 from /usr/local/lib/python3.7/site-packages/pip (python 3.7)
# 找到python3安装的pip3的目录
[root@test ~]# find / -name pip-
*/usr/lib/python2.7/site-packages/pip-20.3.4.dist-info
/usr/share/python-wheels/pip-20.2.2-py2.py3-none-any.whl
/usr/local/lib/python3.7/site-packages/pip-24.0.dist-info
# 进入目录
[root@test ~]# cd /usr/local/lib/python3.7/site-packages/pip-24.0.dist-info
[root@test pip-24.0.dist-info]# ls
AUTHORS.txt entry_points.txt INSTALLER LICENSE.txt METADATA RECORD REQUESTED top_level.txt WHEEL
# 创建一个虚拟环境