标签:log info rac 1.7 call 更改 pkg 出现 charm
def do_install(pkgs): try: import pip except ImportError: error_no_pip() return pip.main([‘install‘] + pkgs) def do_uninstall(pkgs): try: import pip except ImportError: error_no_pip() return pip.main([‘uninstall‘, ‘-y‘] + pkgs)
改为:
def do_install(pkgs): try: # import pip try: from pip._internal import main except Exception: from pip import main except ImportError: error_no_pip() return pip.main([‘install‘] + pkgs) def do_uninstall(pkgs): try: # import pip try: from pip._internal import main except Exception: from pip import main except ImportError: error_no_pip() return pip.main([‘uninstall‘, ‘-y‘] + pkgs)
还是出现报错
def do_install(pkgs): try: # import pip 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: # import pip try: from pip._internal import main except Exception: from pip import main except ImportError: error_no_pip() return main([‘uninstall‘, ‘-y‘] + pkgs)
module 'pip' has no attribute 'main'
标签:log info rac 1.7 call 更改 pkg 出现 charm
原文地址:https://www.cnblogs.com/kunkunZeng/p/9114119.html