Python3 uWSGI立即停止

时间:2014-12-11 05:36:12

标签: django uwsgi

我遇到了一个问题,我无法在我的机器上运行uwsgi。我一直这样:

/usr/bin$ sudo service ppuwsgi start
>>ppuwsgi start/running, process 17452

/usr/bin$ sudo service ppuwsgi status
>>ppuwsgi stop/waiting

我想我可能会遇到与此人here类似的问题。但是,我没有从源代码安装。我看到机器附带了python3.4。但我确实做了

sudo apt-get install libpq-dev python3-dev

甚至可能

sudo apt-get install python-dev

我想我没有安装python两次。我不知道如何检查和看到。我打开了我的usr/local/bin,看到了uwsgi和一些pip东西,但没有python。

最后,这是我的/etc/init/ppuwsgi.conf

# file: /etc/init/ppuwsgi.conf 
description "uWSGI server for PingPlot"

start on runlevel [2345]
stop on runlevel [!2345]

respawn
exec /usr/local/bin/uwsgi --home /home/ubuntu/web/app/ --socket /home/ubuntu/web/ppuwsgi.sock --chmod-socket --module wsgi --pythonpath /home/ubuntu/web/ -H /home/ubuntu/.virtualenvs/pingplot --logto /home/ubuntu/web/logs/uwsgi.log

sock文件和日志文件似乎也被创建(日志文件为空)。我不知道这笔交易是什么。

修改

所以我打开了user / bin /这里是我所有的python项目。

a bunch of Python stuff

编辑:我喜欢

我收到了错误日志中的内容。我只是看不到它,因为我打开了没有sudo的vim。这是错误日志:

*** Starting uWSGI 2.0.8 (64bit) on [Thu Dec 11 05:36:59 2014] ***
compiled with version: 4.8.2 on 09 December 2014 02:42:22
os: Linux-3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014
nodename: ip-172-31-9-208
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root !!! (use the --uid flag) ***
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15925
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
chmod() socket to 666 for lazy and brave users
uwsgi socket 0 bound to UNIX address /home/ubuntu/web/ppuwsgi.sock fd 3
Python version: 2.7.6 (default, Mar 22 2014, 23:03:41)  [GCC 4.8.2]
Set PythonHome to /home/ubuntu/.virtualenvs/pennypledge
ImportError: No module named site

1 个答案:

答案 0 :(得分:-1)

基于错误日志。我改变了我的Python版本。我卸载了uwsgi和pip,然后使用python3 pip重新安装它。

sudo apt-get install python3-pip
sudo pip install uwsgi

然后我能够让uwsgi运行。