Mac下pip 9.0 upgrade pip10显示ImportError: module 'pip' has no attribute 'main'

ImportError: module 'pip' has no attribute 'main' 解决方案

在Mac的硬盘里找到Pycharm CE,右击“显示包内容”

contents/helpers/packaging_tool.py路径锁定目标文件


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)

转自https://blog.csdn.net/qq_32618817/article/details/80370153

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,449评论 0 10
  • 原文 原文下载之后的格式略有点不友好,利用简述的markdown,编辑一下.版权归原作者 PEP Index > ...
    大飞哥阅读 2,553评论 0 0
  • 先创建服务端的APP 1.官网下载Winrun4j。http://winrun4j.sourceforge.net...
    Alex_1799阅读 1,817评论 1 2
  • ~~~只需要引爆,无需添加!在契约下成长!!加油ಠ_ಠ 体验入: 直接面对现在的问题就已经化解99%了,现在的改革...
    能量在此阅读 370评论 1 1
  • 你是 一只轻灵的蟋蟀 初秋里 吱吱吱吱地歌唱 在雨后的夜晚 在我的纱窗外 你顽皮的姿态 在绿叶间蹿跃 撩动了我的欢...
    双枪老太阅读 231评论 0 1