简体   繁体   中英

PermissionError: [Errno 13] Permission denied: .deepface

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

You can give permission to that hidden folder by typing sudo chmod 777 -R /var/www/.deepface . Make sure cheking the permission by cd /var/www/ and ls -lth

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM