pycharm安装 suds模块报错:AttributeError: module 'pip' has no attribute 'main'
需求:安装suds模块
遇到的问题:
 一、报错信息:【file】【Default Settint】---Project Interpreter 点击 
搜索suds安装模块报错

解决:依据上图提示找到C:\Program Files\JetBrains\PyCharm 2017.2.3\helpers\packaging_tool.py 文件的192行和109行
将do_install函数和do_uninstall函数修改为如下格式
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)
二、紧接着又出现如下错误:NameError: name 'pip' is not defined

解决:
上述问题的出现是第一次修改的不彻底导致的:更改do_install函数和do_uninstall函数时返回内容要去掉pip
三、最后又出现:安装suds提示ModuleNotFoundError: No module named 'client'
解决:
没有模块叫 client 的。需要先安装 client ,然后再安装 suds 。
pip install client
pip install suds
参考:https://www.cnblogs.com/Fordestiny/p/8901100.html
参考:https://segmentfault.com/q/1010000014743128
                    
                
                
            
        
浙公网安备 33010602011771号