[Linux] Pip Failed After Update on CentOS 8 Stream
Posted On 2019-10-13
- OS Version: CentOS 8 Stream 1905
- Python Version: 3.6.8
- Pip Version: 9.0.3 ---> 19.2.3
I try to update the pip package in the new CentOS 8, but after upgrade the pip function was broken.
Here is the original file in /usr/bin/pip3
#! /usr/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pip import main
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(main())
After we change the code,
#! /usr/bin/python3.6
# -*- coding: utf-8 -*-
import re
import sys
from pip import __main__
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(__main__._main())
then the pip function will be fix.
That's done.