Python 3.x 致命python错误:py_初始化:无法获取区域设置编码导入错误:没有名为encodings的模块

Python 3.x 致命python错误:py_初始化:无法获取区域设置编码导入错误:没有名为encodings的模块,python-3.x,nginx,uwsgi,Python 3.x,Nginx,Uwsgi,错误消息的重要部分: 我得到以下错误 启动uWSGI 2.0.18 将pythonHome设置为/var/www/demo/venv python版本:3.5.3 致命的Python错误:无法获取区域设置编码 导入错误:没有名为“encodings”的模块 它显示了python版本:3.5.3 然而,在我的venv/lib文件夹中,只有一个包python2.7 这和我的错误有关吗 请帮我解决这个问题 这是我的demo_uwsgi.ini文件 #application's base folder

错误消息的重要部分: 我得到以下错误

启动uWSGI 2.0.18
将pythonHome设置为/var/www/demo/venv
python版本:3.5.3
致命的Python错误:无法获取区域设置编码
导入错误:没有名为“encodings”的模块
它显示了python版本:3.5.3 然而,在我的venv/lib文件夹中,只有一个包python2.7 这和我的错误有关吗

请帮我解决这个问题

这是我的demo_uwsgi.ini文件

#application's base folder
base = /var/www/demo

#python module to import
app = flaskfile     //flaskfile is my flask file
module = %(app)

home = %(base)/venv
pythonpath = %(base)

#socket file's location
socket = /var/www/demo/%n.sock

#permissions for the socket file
chmod-socket    = 666

#the variable that holds a flask application inside the module imported at line #6
callable = app

#location of log files
logto = /var/log/uwsgi/%n.log```

Am I missing plugins or something? I added plugins = python32 in my demo_uwsgi.ini file and it shows no such file or directory. Do I need to change or unset python path or something?

我自己想出来的。删除默认的Nginx配置文件,并在/etc/Nginx中添加新的配置文件。然后逐步按照此链接中的说明进行操作。将所有权从root更改为user。它工作得很好