6 comments
Comment actions Permalink

Looks like you already have `enum` installed for your project interpreter. Please run your script in the system Terminal with the same interpreter as you use in PyCharm. Do you have the same error?

0
Comment actions Permalink

Hi @Anna Marazova

Yes,  I have same error 

Here

0
Comment actions Permalink

But , when I import "enum" like that It works.

Don't Work 

from enum import Enum

Work

import enum
from enum import Enum

Interesting :) 




 

0
Comment actions Permalink

> Yes,  I have same error 

That means that the problem is not related to PyCharm.

Try to use `class Action(Enum)` instead of `class Action(enum.Enum)` in your code.

0
Comment actions Permalink

thanks @Anna Morozova for support

0
Comment actions Permalink

> But , when I import "enum" like that It works.

> Don't Work 

from enum import Enum

> Work

import enum
from enum import Enum

> Interesting :) 

 

In case of `from enum import Enum` you need to write `class Action(Enum)`. If you prefer `import enum` then use `class Action(enum.Enum)` instead.

Also please check https://stackoverflow.com/a/710603https://docs.python.org/3.5/reference/simple_stmts.html#the-import-statement

0

Please sign in to leave a comment.