我至少看过3个关于这个问题的问题。
但我在uWSGI设置文件中有plugins = python3
,没关系!
服务器已启动,一切正常 ...
重启服务器 - 一切都还在运行......
重新加载服务器(或touch reload-file
),您遇到此错误:
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named encodings
更多......我在另一个环境中有另一个项目,touch reload-file
为它工作
任何建议为什么会发生这种情况?
PS:我试图创建一个新的virtualenv
日志:
service uwsgi restart
之后:
...
Sun Dec 29 22:57:21 2013 - detected max file descriptor number: 1024
Sun Dec 29 22:57:21 2013 - lock engine: pthread robust mutexes
Sun Dec 29 22:57:21 2013 - uwsgi socket 0 bound to UNIX address /run/uwsgi/app/test/socket fd 3
Sun Dec 29 22:52:59 2013 - uwsgi socket 1 bound to TCP address 127.0.0.1:3045 fd 5
Sun Dec 29 22:52:59 2013 - Python version: 3.2.3 (default, Sep 25 2013, 19:38:45) [GCC 4.7.2]
Sun Dec 29 22:52:59 2013 - Set PythonHome to /pyenvs/test/
Sun Dec 29 22:52:59 2013 - Python main interpreter initialized at 0x688cc0
Sun Dec 29 22:52:59 2013 - threads support enabled
Sun Dec 29 22:52:59 2013 - your server socket listen backlog is limited to 10000 connections
Sun Dec 29 22:52:59 2013 - *** Operational MODE: preforking ***
Sun Dec 29 22:52:59 2013 - WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x688cc0 pid: 1619 (default app)
Sun Dec 29 22:52:59 2013 - *** uWSGI is running in multiple interpreter mode ***
Sun Dec 29 22:52:59 2013 - spawned uWSGI master process (pid: 1619)
Sun Dec 29 22:52:59 2013 - spawned uWSGI worker 1 (pid: 1628, cores: 1)
Sun Dec 29 22:52:59 2013 - spawned uWSGI worker 2 (pid: 1629, cores: 1)
service uwsgi reload
之后:
Sun Dec 29 22:55:31 2013 - *** Starting uWSGI 1.2.3-debian (64bit) on [Sun Dec 29 22:55:31 2013] ***
...
Sun Dec 29 22:55:31 2013 - detected max file descriptor number: 1024
Sun Dec 29 22:55:31 2013 - lock engine: pthread robust mutexes
Sun Dec 29 22:55:31 2013 - uwsgi socket 0 inherited UNIX address /run/uwsgi/app/test/socket fd 3
Sun Dec 29 22:55:31 2013 - uwsgi socket 1 inherited INET address 127.0.0.1:3045 fd 5
Sun Dec 29 22:55:31 2013 - Python version: 3.2.3 (default, Sep 25 2013, 19:38:45) [GCC 4.7.2]
Sun Dec 29 22:55:31 2013 - Set PythonHome to /pyenvs/test/
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named encodings
更新1
绝对是虚拟环境。复制我的旧VEnv并使用不会导致此问题
仍然不知道为什么新创建的不起作用
仅复制python
可执行文件无效。
答案 0 :(得分:1)
我不知道发生了什么事,因为我做了很多事情:
pip install uwsgi
并使用supervisord 现在它正在运作。谢谢罗伯托。