This is an old copy of the Python FAQ. The information here may be outdated.

I need help; I'm getting an error in my program. What should I do?

If you are getting an error in your Python program that you don’t understand, post the error message and any relevant code. Copy and paste the entire error message into your email, including the traceback. Don’t paraphrase the error message. The error message has details that can help resolve the issue that caused the error.

A complete traceback starts with the line Traceback (most recent call last) and ends with a line that describes the specific error. An example:

Traceback (most recent call last):
  File "", line 42, in ?
    data = myfunc("myfile.txt")
  File "", line 25, in myfunc
    f = open(filename)
IOError: [Errno 2] No such file or directory: 'myfile.txt'

The filenames and source code lines may often provide important clues.



A Django site. rendered by a django application. hosted by webfaction.