2 qq 18884745 qq_18884745 于 2016.09.06 21:48 提问

python无法导入枚举类

运行后的提示

 Traceback (most recent call last):
  File "fenbushijincheng.py", line 4, in <module>
    from multiprocessing.managers import BaseManager
  File "C:\Users\xx\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\__init__.py", line 16, in <module>
    from . import context
  File "C:\Users\xx\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\context.py", line 5, in <module>
    from . import process
  File "C:\Users\xx\AppData\Local\Programs\Python\Python35-32\lib\multiprocessing\process.py", line 18, in <module>
    import signal
  File "C:\Users\xx\AppData\Local\Programs\Python\Python35-32\lib\signal.py", line 4, in <module>
    from enum import IntEnum as _IntEnum
  File "C:\Users\xx\xxgit\python\enum.py", line 2, in <module>
    from enum import enum
ImportError: cannot import name 'enum'

1个回答

qq_18884745
qq_18884745   2016.09.06 22:01
已采纳

自己找到答案了,之前自己创建了一个enum.py的类,本来应该导入自带库里的类,不知为何会导入我这个,吧自己写的这个改名字应该就可以了。

Csdn user default icon
上传中...
上传图片
插入图片