How do I create a directory in root directory using python.pathlib.Path? Answer It is works if you run your script with sudo. Or you can use os module:
Tag: pathlib
Python pathlib make directories if they don’t exist
If I wanted to specify a path to save files to and make directories that don’t exist in that path, is it possible to do this using the pathlib library in one line of code? Answer Yes, that is Path.mkdir: From the docs: If parents is true, any missing parents of this path are created as needed; they are created