Python2.7 install pip

Python2.7 install pip

问题背景:steghide 本身并不支持爆破,需要一些其他的方法 https://github.com/Va5c0/Steghide-Brute-Force-Tool ,这个脚本需要安装库 progressbar(使用的是 python2)

默认 pip 指向的是 python3

1
2
3
┌──(kali㉿kali)-[/usr/lib/python2.7/dist-packages/pip-23.1.2]
└─$ pip -V
pip 23.2.1 from /home/kali/.local/lib/python3.11/site-packages/pip (python 3.11)

如何为 python2.7 安装 pip 成了一个问题,尝试搜索得到的答案是 python2.7 已经不在维护,kali 中也删去了 python2.7 的 pip

解决方案:

New Kali build cannot install pip for python2.7

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
┌──(kali㉿kali)-[~]
└─$ curl https://bootstrap.pypa.io/pip/2.7/get-pip.py -o py2-get-pip.py

┌──(kali㉿kali)-[~]
└─$ python2 py2-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.
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 686 kB/s
Collecting wheel
Downloading wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Installing collected packages: pip, wheel
WARNING: The scripts pip, pip2 and pip2.7 are installed in '/home/kali/.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/kali/.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.37.1

┌──(kali㉿kali)-[~]
└─$ python2 -m pip install --user --upgrade progressbar2
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 progressbar2
Downloading progressbar2-3.55.0-py2.py3-none-any.whl (26 kB)
Collecting six
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting python-utils>=2.3.0
Downloading python_utils-2.7.1-py2.py3-none-any.whl (14 kB)
Installing collected packages: six, python-utils, progressbar2
Successfully installed progressbar2-3.55.0 python-utils-2.7.1 six-1.16.0
WARNING: You are using pip version 20.3.4; however, version 23.2.1 is available.
You should consider upgrading via the '/usr/bin/python2 -m pip install --upgrade pip' command.

Python2.7 install pip
https://i3eg1nner.github.io/2023/09/ea477c3a54b7.html
作者
I3eg1nner
发布于
2023年9月5日
许可协议