且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

uWSGI 说:“导入错误:没有名为 wsgi 的模块";

更新时间:2022-05-21 21:25:37

你已经指定了 wsgi,所以 uWSGI 正在按照你的要求去做加载一个名为 wsgi 的模块并提供它.你的python脚本是如何安装的?你甚至没有提到你有一个 python 程序可以服务.

You have specified <module>wsgi</module>, and so uWSGI is doing what you have asked of it, to load a module named wsgi and serve it. How is your python script installed? You haven't even mentioned that you have a python program to serve.

可能,您真正想要的是使用 <file> 指令告诉 uWSGI 从中读取 python 文件的路径,并提供该路径.如果您使用的是已安装的模块,则应将 <module> 标记中的 wsgi 替换为您尝试提供的相应模块.

Probably, what you really want is to use the <file> directive to tell uWSGI the path to read a python file from, and serve that. If you are using an installed module, you should substitute wsgi in the <module> tag with the appropriate module you are trying to serve.