PermissionError: [Errno 13] Permission denied: .deepface

  deepface, python, ubuntu

I have installed a basic python server with deepface library with apache2 on ubuntu.

The library makes a .deepface directory on app initialization but it is unable to do so due to permission denied error as it’s hidden in linux by default. I am getting the following error

File "/usr/local/lib/python3.8/dist-packages/deepface/commons/", line 51, in initializeFolder, referer:
[wsgi:error] [pid 61915:tid 139981666330368]     os.mkdir(home+"/.deepface"), referer:
[[wsgi:error] [pid 61915:tid 139981666330368] PermissionError: [Errno 13] Permission denied: '/var/www/.deepface', referer:

how can I give the library to have complete access to create and access hidden files and directories.

this is my folder

from flask import Flask,request
from deepface import DeepFace

app = Flask(__name__)

def helloworld():
  return "helloworld"

def hello():
   # print(request.form.get('base1'))
    base1 = request.form.get('base1')
    base2 = request.form.get('base2')

    return DeepFace.verify(base1, base2,model_name='Facenet')

if __name__ == "__main__":

Enviroment :
OS : Ubuntu 20.04.3 LTS
Python 3.8.10

Source: Python Questions