Uninstalling setuptools in python2.7 causes pip to not work normally. At this time, you will not be able to install setuptools back, causing the entire environment to be useless. Hence the need to restore pip and setuptools.
method one:
Download https://bootstrap.pypa.io/ez_setup.py locally and execute
python ez_setup.py
If method one fails, you can restore pip, the specific method
manual download
https://bootstrap.pypa.io/pip/2.7/get-pip.py
Then execute python get-pip.py
By the way, if your python3 pip is broken, you can download it
https://bootstrap.pypa.io/pip/get-pip.py
Then execute python get-pip.py