一、Kali 下安装pip3
1.1 方法一
sudo apt-get install python3-pip
1.2 方法二
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py sudo python3 get-pip.py
二、Kali 下安装pip2
2.1 前言
由于python 推广3 版本,同时Kali 作为非常激进的系统,所以就砍掉了python 2 版本的pip 命令。但是由于很多工具使用python2 编写的,需要使用pip2 下载相关依赖模块,就有了篇文章。
2.2 安装过程
首先,去bootstrap.pypa.io 下载对应python 版本的pip。我的是pip-2.7.py 。
┌──(ajest AJESTdeKALI)-[~] └─$ wget https://bootstrap.pypa.io/pip/2.7/get-pip.py --2021-08-09 11:47:44-- https://bootstrap.pypa.io/pip/2.7/get-pip.py Resolving bootstrap.pypa.io (bootstrap.pypa.io)... 151.101.228.175, 2a04:4e42:11::175 Connecting to bootstrap.pypa.io (bootstrap.pypa.io)|151.101.228.175|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 1908226 (1.8M) [text/x-python] Saving to: ‘get-pip.py’ get-pip.py 100%[=======================================>] 1.82M 1.33MB/s in 1.4s 2021-08-09 11:47:55 (1.33 MB/s) - ‘get-pip.py’ saved [1908226/1908226] ┌──(ajest AJESTdeKALI)-[~] └─$ ls 01CTFer Documents Edraw Music Public Templates Videos Desktop Downloads get-pip.py Pictures share tools vulhub ┌──(ajest AJESTdeKALI)-[~] └─$ mv get-pip.py get-2.7-pip.py ┌──(ajest AJESTdeKALI)-[~] └─$ python get-2.7-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. Defaulting to user installation because normal site-packages is not writeable Collecting pip<21.0 Downloading pip-20.3.4-py2.py3-none-any.whl (1.5 MB) |████████████████████████████████| 1.5 MB 730 kB/s Collecting wheel Downloading wheel-0.36.2-py2.py3-none-any.whl (35 kB) Installing collected packages: pip, wheel WARNING: The scripts pip, pip2 and pip2.7 are installed in '/home/ajest/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script wheel is installed in '/home/ajest/.local/bin' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-20.3.4 wheel-0.36.2 ┌──(ajest AJESTdeKALI)-[~] └─$
2.3 可能遇到的问题
问题一:error: invalid command 'egg_info'
pip install --upgrade setuptools
2.4 安装pip3过程
py007@kali:~$ curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
8 2518k 8 208k 0 0 12221 0 0:03:30 0:00:17 0:03:13 16296
100 2518k 100 2518k 0 0 12806 0 0:03:21 0:03:21 --:--:-- 15425
py007@kali:~$
py007@kali:~$ sudo python3 get-pip.py
Collecting pip
Downloading pip-23.1.2-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 12.7 kB/s eta 0:00:00
Collecting wheel
Downloading wheel-0.40.0-py3-none-any.whl (64 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.5/64.5 kB 10.2 kB/s eta 0:00:00
Installing collected packages: wheel, pip
Successfully installed pip-23.1.2 wheel-0.40.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