Posts

Showing posts from January, 2017

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 searching around in Google, I found that a blog

Errors: Linux System Errors

Source link: http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html When system requests fail, error code are returned. To understand the nature of the error these codes need to be interpreted. They are recorded in:- /usr/include/asm/errno.h Here is a copy of that file as of Aug 2004 on RedHat 7.3 #define EPERM 1 /* Operation not permitted */ #define ENOENT 2 /* No such file or directory */ #define ESRCH 3 /* No such process */ #define EINTR 4 /* Interrupted system call */ #define EIO 5 /* I/O error */ #define ENXIO 6 /* No such device or address */ #define E2BIG 7 /* Arg list too long */ #define ENOEXEC 8 /* Exec format error */ #define EBADF 9 /* Bad file number */ #define ECHILD 10 /* No child processes */ #define EAGAIN 11 /* Try again */ #define ENOMEM