Windows解决多版本python执行pip3时出错AttributeError: module 'enum' has no attribute 'IntFlag'?

摘要:
因为python 3.4有一个标准库枚举模块,所以应该卸载enum34,因为枚举,它不再与标准库中的枚举兼容。python 3.6中添加了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.

免责声明:文章转载自《Windows解决多版本python执行pip3时出错AttributeError: module 'enum' has no attribute 'IntFlag'?》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Mac搭建nginx+rtmp服务器Hbase的配置与使用下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

python 调用 opencv 实现 图片文本倾斜校正

本项目为python项目需要安装python及python的opencv模块:opencv_python-4.0.1-cp37-cp37m-win32.whl 和 python的矩阵运算模块:numpy。        1、第一步,安装python3.7,具体安装步骤略。        2、第二步,使用pip安装python的矩阵运算模块:numpy。  ...

pycharm快捷键、常用设置、配置管理

http://blog.csdn.net/pipisorry/article/details/39909057 pycharm学习技巧 Learning tips /pythoncharm/help/tip of the day:A special variant of the Code Completion feature invoked by pres...

Python多进程和多线程(跑满CPU)及IO模型详解

目录 Python多进程和多线程(跑满CPU)IO模型详解 Python多进程和多线程(跑满CPU) 转载自:https://www.liaoxuefeng.com/wiki/1016959663602400/1017627212385376 Python多进程和多线程(跑满CPU****) 概念 任务可以理解为进程(process),如打开一...

python中的生成器(二)

一. 剖析一下生成器对象 先看一个简单的例子,我们创建一个生成器函数,然后生成一个生成器对象 defgen(): print('start ..') for i in range(3): yieldi print('end...') G=gen() print(type(G)) >> <type 'gene...

Python图像处理 PIL中convert('L')函数原理

1. img = img.convert()   PIL有九种不同模式: 1,L,P,RGB,RGBA,CMYK,YCbCr,I,F。 1.1 img.convert('1')   为二值图像,非黑即白。每个像素用8个bit表示,0表示黑,255表示白。 1.1.1 Code 1 from PIL import Image 2 3 4 def conv...

如何用C++ 写Python模块扩展(一)

最近做一个小软件需要用到虚拟摄像头,在网上找了找虚拟摄像头软件 发现 Vcam 软件有个API 可以用,有API当然是最好的啦,但是这个API只有C++和C#的。都说 “人生苦短,得用python”能用Python解决的事情尽量别用C++,于是萌生了自己写个模块的想法。 值得庆幸的是之前研究过一段时间C++。 先贴两个python官方文档链接C API第三...