Python3 Incompatibility

I was able to install pip but I got this error then:

python2.7 -m pip install impacket 1 ⨯
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 Release process - pip documentation v23.1.dev0 pip 21.0 will remove support for this functionality.
Defaulting to user installation because normal site-packages is not writeable
Collecting impacket
Downloading impacket-0.9.22.tar.gz (1.4 MB)
|████████████████████████████████| 1.4 MB 1.2 MB/s
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2.7 -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘"’"’/tmp/pip-install-aHhqmh/impacket/setup.py’“'”‘; file=’“'”‘/tmp/pip-install-aHhqmh/impacket/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-SfC5Dq
cwd: /tmp/pip-install-aHhqmh/impacket/
Complete output (10 lines):
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘extras_require’
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: ‘install_requires’
warnings.warn(msg)
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.