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/functions.py", line 51, in initializeFolder, referer: http://127.0.0.1/flaskapp
[wsgi:error] [pid 61915:tid 139981666330368]     os.mkdir(home+"/.deepface"), referer: http://127.0.0.1/flaskapp
[[wsgi:error] [pid 61915:tid 139981666330368] PermissionError: [Errno 13] Permission denied: '/var/www/.deepface', referer: http://127.0.0.1/flaskapp

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

this is my flaskapp.py folder

from flask import Flask,request
from deepface import DeepFace

app = Flask(__name__)


@app.route("/")
def helloworld():
  return "helloworld"


@app.route("/verify",methods=['POST'])
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__":
  app.run()

Enviroment :
OS : Ubuntu 20.04.3 LTS
Python 3.8.10

Source: Python Questions

LEAVE A COMMENT