Tutorial Example

Fix Python Signal AttributeError: module ‘signal’ has no attribute ‘SIGALRM’ – Python Tutorial

We can use python signal to limit the maximum runtime of python function. However, you may find this singal error:

AttributeError: module ‘signal’ has no attribute ‘SIGALRM’. In this tutorial, we will introduce you how to fix this error.

In python 3.5 library.

https://docs.python.org/3.5/library/signal.html

we can find this sentence:

On Windows, signal() can only be called with SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, or SIGBREAK. A ValueError will be raised in any other case.

Which means SIGALRM can not be used on windows.

To fix this error, you shoud change your system operation or change the application and do not use python signal library.