How to Solve NameError: name 'Lock' is not defined -- threading

Solution: Import the 'Lock' module

To Solve the error, add the following line to the top of your code.

from threading import Lock

 

For more information:
Python threading Lock