Access Denied Error While Making A Folder In Python

I’m Getting A Access Denied Error While Making A Folder Using

os.makedirs('Image Classifier')

This Is My Code :-

    def ImageClassifier(model):
        print('Using The Model',model)
        if os.path.isdir('Image Classifier'):
            error = input('Directory "Image Classifier" Already Exists. Do You Want To Delete It? (Y/N)')
            if error == 'y' or error == 'Y':
                shutil.rmtree('Image Classifier')
                print('Folder Deleted Successfully.')
                os.makedirs('Image Classifier')
            else:
                print('Command Terminated.')
                quit()

While I Run This In WSL It Runs Perfectly!

Thanks In Advance!,
Yash

Source: StackOverflow

LEAVE A COMMENT