运行: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

uwsgi --http :8888 --wsgi-file test.py(无法部署)相关推荐

  1. BUG之路2--ubuntu安装uwsgi测试报错:failed to open python file test.py

    心路历程 毫无疑问,又是能让我跳楼的BUG,但是结果都一样,很小的细节,卡我两天时间. BUG过程: 在ubuntu上部署django项目时,需要安装uwsgi服务器.根据教程安装完之后,然后会有一个 ...

  2. 安装Phoenix时./sqlline.py执行报错File ./sqlline.py, line 27, in module import argparse ImportError: No ...

    问题现象 Traceback (most recent call last):File"./sqlline.py", line 27, in <module>impor ...

  3. C:\Python27\python.exe: can't open file '2.py': [Errno 2] No such file or directory

    最近开始学习了"笨方法学python",在练习的第一个程序就出现了如下错误: C:\Python27\python.exe: can't open file '2.py': [Er ...

  4. windows执行python文件提示SyntaxError: Non-ASCII character ‘\xe9‘ in file 1.py on line 7, but no encoding d

    1.问题 windows环境下执行python文件,提示错误如下 SyntaxError: Non-ASCII character '\xe9' in file 1.py on line 7, but ...

  5. 【Python】SyntaxError: Non-ASCII character ‘\xe8‘ in file main.py on line 7, but no encoding declared;

    Windows系统上能运行的Python程序,传到Linux系统上就无法运行,python main.py报错:SyntaxError: Non-ASCII character '\xe8' in f ...

  6. 【Python】SyntaxError: Non-UTF-8 code starting with ‘\xe5‘ in file XXX.py on line XX 的解决方法

    问题描述 在写Python爬虫的时候遇到了这个问题: SyntaxError: Non-UTF-8 code starting with '\xe5' in file XXX.py on line X ...

  7. python Django创建数据库时can't open file 'manage.py': [Errno 2] No such file or directory

    1.在学习Diango新建项目后,进行创建数据库的时候,使用以下命令: python manage.py migrate 2.发现竟然报can't open file 'manage.py': [Er ...

  8. python命令行运行django项目, can‘t open file ‘manage.py‘ 问题解决

    python命令行运行django项目, can't open file 'manage.py' 问题解决 参考文章: (1)python命令行运行django项目, can't open file ...

  9. 关于python无法显示中文的问题:SyntaxError: Non-ASCII character '\xe4' in file test.py on line 3

    本文转载于:http://www.cnblogs.com/KarryWang/p/3260858.html 想在python代码中输出汉字.但是老是出现SyntaxError: Non-ASCII c ...

最新文章

  1. 解决使用Navicat等工具进行连接登录mysql的1130错误,无法使用Ip远程连接的问题(mysql为8.0版本)
  2. DriveInfo类取得计算机的磁盘信息
  3. SAP Spartacus自定义指令cxOutlet的工作原理
  4. nodejs-- vuex中mapActions
  5. jupyternotebook运行python_jupyter notebook参数化运行python方式
  6. ~~试除法判定质数 (附模板题)
  7. linux c开发项目,linux c 服务器开发项目
  8. 64位整数乘法(类快速幂)
  9. 史上最全最白话RNN原理
  10. Facebook vs Chrome 关公秦琼的未来之战,互联网营销
  11. 频谱泄露和吉布斯现象
  12. 助力数字化转型,华为“铁三角”落地
  13. JAVA中数字转大写字母_java实现数字转大写
  14. ibm笔记本修复计算机开机按,联想thinkpad重装系统按什么键_联想thinkpad电脑重装系统按哪个键-win7之家...
  15. CSP2022 初赛游记
  16. CIC 滤波器——不同长度的5级CIC滤波器的频谱特性
  17. 网上书店eclipse---Java+SQL Server+swing
  18. HostMonitor监控软件
  19. 【学习笔记】状态转移矩阵
  20. 计算机技术流浪地球,科幻圈观察:《流浪地球》原著作者刘慈欣:计算机技术是个坑!...

热门文章

  1. SSH框架hibernate无法添加或修改,saveorupdate方法失效
  2. java List和数组转换
  3. 《jquery实战》javascript 必知必会(1)
  4. 浏览器 CSS Hack 收集
  5. 2014.12.1---Thema:EchartsD3
  6. [Ubuntu] ubuntu13.04 从php5.4降级到php5.3
  7. 募捐:请帮助一名 Linux 程序员的女儿
  8. 4-Spring Boot 的视图
  9. mysql操作json优点和缺点_详解Mysql中的JSON系列操作函数
  10. android恢复联系人,如何从Android手机恢复联系人[最佳方式]