I tried you script with python3.2.3
and it worked. Do you have a file named cmd.py
in the same directory as this file is in? If you do, then import cmd
would not import the right module. Instead, it would import cmd.py
in the current directory.
I created a file called cmd.py
in the directory and got the same error as you did when trying to run your script. So delete cmd.py
that is in the current directory or name it something else if you have it there.