Are you running the python script in IDLE? Is it possible that a newer version of Python was installed? If you are using a shell to run the python script, check the pathways that are being used (in the IDLE shell, look under the File menu for path browser). I ran into a problem after upgrading to 10.1 but when I opened a .py file, my computer defaulted to python 2.6 instead of python 2.7 which is used by 10.1.