uwsgi --http:8888 --wsgi-file test.py(デプロイできません)

実行:uwsgi --http:8888 --wsgi-file test.py

エラー:

huitao@huitao-virtual-machine:/usr/local/bin/python$ uwsgi --http-socket :8001 --plugin python --wsgi-file test.py
open("./python_plugin.so"): No such file or directory [core/utils.c line 3732]
!!! UNABLE to load uWSGI plugin: ./python_plugin.so: cannot open shared object file: No such file or directory !!!
*** Starting uWSGI 2.0.19.1 (64bit) on [Sun Mar 21 10:11:32 2021] ***
compiled with version: 5.4.0 20160609 on 21 March 2021 01:57:51
os: Linux-4.15.0-112-generic #113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020
nodename: huitao-virtual-machine
machine: x86_64
clock source: unix
detected number of CPU cores: 4
current working directory: /usr/local/bin/python
detected binary path: /home/huitao/.local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 15448
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)
uwsgi socket 0 bound to TCP address :8001 fd 3
Python version: 3.5.2 (default, Jan 26 2021, 13:30:48)  [GCC 5.4.0 20160609]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x1458c00
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72904 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x1458c00 pid: 56012 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 56012, cores: 1)

これは、uWSGIの pythonプラグインがインストールまたはロードされていないことを意味します。動作を確認します。

私のシステムはubuntu20.04です。インストールすることを選択してください

$ apt-get install uwsgi-plugin-python

 

huitao@huitao-virtual-machine:/usr/local/bin/python$ sudo apt-get install uwsgi-plugin-python
[sudo] huitao 的密码: 
正在读取软件包列表... 完成
正在分析软件包的依赖关系树       
正在读取状态信息... 完成       
建议安装:
  python-uwsgidecorators
下列【新】软件包将被安装:
  uwsgi-plugin-python
升级了 0 个软件包,新安装了 1 个软件包,要卸载 0 个软件包,有 26 个软件包未被升级。
需要下载 72.8 kB 的归档。
解压缩后会消耗 261 kB 的额外空间。
获取:1 http://cn.archive.ubuntu.com/ubuntu xenial-updates/universe amd64 uwsgi-plugin-python amd64 2.0.12-5ubuntu3.2 [72.8 kB]
已下载 72.8 kB,耗时 8秒 (8,480 B/s)                                                   
正在选中未选择的软件包 uwsgi-plugin-python。
(正在读取数据库 ... 系统当前共安装有 218544 个文件和目录。)
正准备解包 .../uwsgi-plugin-python_2.0.12-5ubuntu3.2_amd64.deb  ...
正在解包 uwsgi-plugin-python (2.0.12-5ubuntu3.2) ...
正在处理用于 man-db (2.7.5-1) 的触发器 ...
正在设置 uwsgi-plugin-python (2.0.12-5ubuntu3.2) ...
/var/lib/dpkg/info/uwsgi-plugin-python.postinst: 61: [: Illegal number: 

デプロイ:

huitao@huitao-virtual-machine:/usr/local/bin/python$ uwsgi --http :8888 --wsgi-file test.py

 

リクエストインターフェース、成功!

のLinux アルパイン、あなたは現在、その場所を指定する必要があります。

$ apk add --update uwsgi-python
$ uwsgi --plugins-dir /usr/lib/uwsgi/ --need-plugin python --plugins-list
*** uWSGI loaded generic plugins ***

*** uWSGI loaded request plugins ***
0: python
...

または、次の方法でフルパスを指定できます。

$ uwsgi --plugin /usr/lib/uwsgi/python_plugin.so --plugins-list

 

おすすめ

転載: blog.csdn.net/chehec2010/article/details/115047813