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 Alpine上,您当前必须指定它的位置:

$ 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

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值