How to Solve NameError: name 'Path' is not defined -- pathlib

Solution: Import the 'Path' module

# Add the following line to the top of your code
from pathlib import Path

 

For more information:
pathlib Path