生产中的绘图文件权限错误



我最近使用 gunicorn 将烧瓶环境中的绘图图移动到生产环境。

由于某种原因,我收到以下错误:

return _bootstrap._gcd_import(name[level:], package, level)                 
  File "/var/www/html/dir/flask-gentelella/app/home/routes.py", line 27, i
n <module>                                                                      
    plotly.tools.set_credentials_file(username='users', api_key='abc4')                                                                   
  File "/home/ec2-user/anaconda3/lib/python3.7/site-packages/plotly/tools.py", l
ine 130, in set_credentials_file                                                
    raise exceptions.PlotlyError("You don't have proper file permissions "      
plotly.exceptions.PlotlyError: You don't have proper file permissions to run this function.

我无法纠正它,因为这不会在虚拟环境中发生

请指导

函数set_credentials_file尝试将凭据写入以下文件:~/.plotly_credentials .

主文件夹 ( ~) 的权限可能不正确,Python 进程无法在此位置写入。

查看运行进程的用户的主文件夹的权限。

最新更新