'Pip can't work with error:dynamic module does not define module export function (PyInit__posixsubprocess) in Centos7

When I run pip3 in Centos, it cann't work.

My Python version is 3.6.8. Pip version is 2.21.

But when I run pip(pip2), It work normally.

pip3
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/usr/local/lib/python3.6/site-packages/pip/_internal/cli/cmdoptions.py", line 21, in <module>
    from pip._vendor.packaging.utils import canonicalize_name
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/packaging/utils.py", line 8, in <module>
    from .tags import Tag, parse_tag
  File "/usr/local/lib/python3.6/site-packages/pip/_vendor/packaging/tags.py", line 6, in <module>
    import platform
  File "/usr/lib64/python3.6/platform.py", line 116, in <module>
    import sys, os, re, subprocess
  File "/usr/lib64/python3.6/subprocess.py", line 136, in <module>
    import _posixsubprocess
ImportError: dynamic module does not define module export function (PyInit__posixsubprocess)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source