zoukankan      html  css  js  c++  java
  • Windows解决多版本python执行pip3时出错AttributeError: module 'enum' has no attribute 'IntFlag'?

    摘要

    本机装有python2.7和python3.6,执行pip和pip2时没有问题,执行pip3时提示:

    C:Users>pip3
    Traceback (most recent call last):
      File "e:python36lib
    unpy.py", line 193, in _run_module_as_main
        "__main__", mod_spec)
      File "e:python36lib
    unpy.py", line 85, in _run_code
        exec(code, run_globals)
      File "E:Python36Scriptspip3.exe\__main__.py", line 2, in <module>
      File "e:python36lib
    e.py", line 142, in <module>
        class RegexFlag(enum.IntFlag):
    AttributeError: module 'enum' has no attribute 'IntFlag'

    原因:

    英文:This is likely caused by the package enum34. Since python 3.4 there's a standard library enum module, so you should uninstall enum34, which is no longer compatible with the enum in the standard library since enum.IntFlag was added in python 3.6.

    中文:这可能是由enum34包引起的。因为python 3.4中有一个标准库枚举模块,所以您应该卸载enum34,它不再与标准库中的枚举兼容,因为枚举。IntFlag是在python 3.6中添加的。

    解决办法:

    pip uninstall enum34  

    #卸载enum34

    卸载后执行pip3,成功,昨天整了大半天终于解决了

    C:Users>pip3
    
    Usage:
      pip3 <command> [options]
    
    Commands:
      install                     Install packages.
      download                    Download packages.
      uninstall                   Uninstall packages.
      freeze                      Output installed packages in requirements format.
      list                        List installed packages.
      show                        Show information about installed packages.
      check                       Verify installed packages have compatible dependencies.
      config                      Manage local and global configuration.
      search                      Search PyPI for packages.
      wheel                       Build wheels from your requirements.
      hash                        Compute hashes of package archives.
      completion                  A helper command used for command completion.
      help                        Show help for commands.
  • 相关阅读:
    [网站设计]网站设计的流程
    教你几招如何看透一个人
    难得迷茫
    java 日期 加减 运算
    第01章 SQL Server数据库基础 读后感
    [网站设计]如何设计一个成功的网站
    [网站设计] 素材网罗
    转载个人毕业5年职业感想
    SWTDesigner
    [存档]asp.net夜话之十一:web.config详解收藏
  • 原文地址:https://www.cnblogs.com/gcgc/p/10062727.html
Copyright © 2011-2022 走看看