Python2 error (I assume stops from running a script)

Hi, can anyone help me with this?
I am struggling to make a script run.

TODAY BELOW:
sudo pip2 install -r requirements.txt

I get this:

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 h t t p s://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.
Collecting colorama>=0.3.9
Using cached colorama-0.4.4-py2.py3-none-any.whl (16 kB)
Collecting pyfiglet>=0.7.5
Using cached pyfiglet-0.8.post1-py2.py3-none-any.whl (865 kB)
Collecting termcolor>=1.1.0
Using cached termcolor-1.1.0.tar.gz (3.9 kB)
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-SZEsZ2/termcolor/setup.py’"’"’; _file=’"’"’/tmp/pip-install-SZEsZ2/termcolor/setup.py’"’"’;f=getattr(tokenize, ‘"’"‘open’"’"’, open)(file);code=f.read().replace(’"’"’\r\n’"’"’, ‘"’"’\n’"’"’);f.close();exec(compile(code, _file, ‘"’"‘exec’"’"’))’ egg_info --egg-base /tmp/pip-pip-egg-info-oggYOA
cwd: /tmp/pip-install-SZEsZ2/termcolor/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …]
or: setup.py --help [cmd1 cmd2 …]
or: setup.py --help-commands
or: setup.py cmd --help

error: invalid command 'egg_info'                                        
----------------------------------------                                 

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

Then I still tried to run:

python sigploit.py

                                       1 ⨯

Traceback (most recent call last):
File “sigploit.py”, line 16, in
from ss7.tracking import *
File “/home/kali/SigPloit/ss7/tracking.py”, line 14, in
import sigploit
File “/home/kali/SigPloit/sigploit.py”, line 21, in
from gtpmain import *
File “/home/kali/SigPloit/gtpmain.py”, line 12, in
import gtp.info
File “/home/kali/SigPloit/gtp/info.py”, line 18, in
from attacks.info import discover_gtp_nodes
File “/home/kali/SigPloit/gtp/attacks/info/discover_gtp_nodes.py”, line 39, in
from gtp_v2_core.utilities.configuration_parser import parseConfigs
File “/home/kali/SigPloit/gtp/gtp_v2_core/utilities/configuration_parser.py”, line 38, in
from configobj import ConfigObj, ConfigObjError
ImportError: No module named configobj

YESTERDAY BELOW:
***I believe it could be an error from python2 which it seems is no longer supported on Kali although I need it to run the script.
I installed all packages/libs etc yesterday, I even formatted the SSD hard drive and installed Kali from scratch, and still, I get the above errors and below:

sudo pip install -r requirements.txt

Requirement already satisfied: colorama>=0.3.9 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 1)) (0.4.4)
Requirement already satisfied: pyfiglet>=0.7.5 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 2)) (0.8.post0)
Requirement already satisfied: termcolor>=1.1.0 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 3)) (1.1.0)
Requirement already satisfied: configobj>=5.0.6 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 4)) (5.0.6)
Requirement already satisfied: IPy>=0.83 in /usr/lib/python3/dist-packages (from -r requirements.txt (line 5)) (1.1)
Requirement already satisfied: pysctp>=0.6 in /usr/local/lib/python3.9/dist-packages (from -r requirements.txt (line 6)) (0.6.1)
WARNING: Running pip as root will break packages and permissions. You should install packages reliably by using venv: h t t p s://pip.pypa.io/warnings/venv

┌──(root💀kali)-[/home/kali/SigPloit]
└─# python sigploit.py
Traceback (most recent call last):
File “sigploit.py”, line 16, in
from ss7.tracking import *
File “/home/kali/SigPloit/ss7/tracking.py”, line 14, in
import sigploit
File “/home/kali/SigPloit/sigploit.py”, line 21, in
from gtpmain import *
File “/home/kali/SigPloit/gtpmain.py”, line 12, in
import gtp.info
File “/home/kali/SigPloit/gtp/info.py”, line 18, in
from attacks.info import discover_gtp_nodes
File “/home/kali/SigPloit/gtp/attacks/info/discover_gtp_nodes.py”, line 39, in
from gtp_v2_core.utilities.configuration_parser import parseConfigs
File “/home/kali/SigPloit/gtp/gtp_v2_core/utilities/configuration_parser.py”, line 38, in
from configobj import ConfigObj, ConfigObjError
ImportError: No module named configobj

┌──(root💀kali)-[/home/kali/SigPloit]
└─# pip2 -V 1 ⨯
Command ‘pip2’ not found, did you mean:
command ‘pip’ from deb python3-pip
command ‘pip3’ from deb python3-pip
command ‘nip2’ from deb nip2
Try: apt install

Same outcome before and after reinstalling Kali…

Hi Partalian,

Welcome to our forums.

This warning may point to the root of this problem:

Which would lead me to believe that you will not be able to use anything written in Python 2.7 with any fresh (21+) pip version.

I suggest you upgrade to Python 3, pip’s site clearly states that they dropped support for the old Python version.

Also always use
sudo -H pip…

Python error checker tool allows to find syntax errors (lint). You can test your Python code online directly in your browser. If a syntax error is detected, then the line in error is highlighted, and it jumps to it to save time (no need to search the line).

Regards,
Rachel Gomez