Traceback shows that you didn't supply filename.
usage: if filename = myfile.txt,command:
example (from command line):
usage: if filename = myfile.txt,command:
chardet2 myfile.txt
example (from command line):
Output:$ chardet results.txt
results.txt: ascii with confidence 1.0