Resolve issue ImportError: No module named thrift.Thrift when running python script
When running python script which using struct and/or service defined in thrift, a problem shows up with the error message below: Traceback (most recent call last): File "./test.py", line 8, in <module> from test import TestService File "../thrift/gen-py/test/TestService.py", line 9, in <module> from thrift.Thrift import TType, TMessageType, TException, TApplicationException ImportError: No module named thrift.Thrift From the error message we can see that the python script test.py import a module TestService which is defined in a thrift and the thrift-generated python file is "../thrift/gen-py/test/TestService.py, and the file TestService.py imports TType, TMessageType, TException, TApplicationException and get ImportError. It must be a configuration issue since TType, TMessageType, TException, and TApplicationException should be included when Thrift is installed. After sear...