Python安装模块错误AttributeError: module 'pip' has no attribute 'main'

问题:AttributeError: module ‘pip’ has no attribute ‘main’

找到G:\PyCharm 2017.1\helpers\packaging_tool.py文件

#104行左右,注意空格问题
def do_install(pkgs):
    try:
        try:
            from pip._internal import main
        except Exception:
            from pip import main
    except ImportError:
        error_no_pip();
    return main(['install'] + pkgs);

def do_uninstall(pkgs):
    try:
        try:
            from pip._internal import main
        except Exception:
            from pip import main
    except ImportError:
        error_no_pip();
            
    return main(['uninstall', '-y'] + pkgs);

你可能感兴趣的:(Python)