尝试从主管运行 gunicorn 时出现错误 - 错误:类 uri“simple”无效或未找到

尝试从主管运行 gunicorn 时出现错误 - 错误:类 uri“simple”无效或未找到

我已经使用 Django + gunicorn + virtualenv + Supervisord 环境成功运行了 2 个 django 项目(在同一个虚拟环境中,使用 python 2.7)。但现在我正尝试在 python 3.2.3 中运行另一个项目,因此我创建了另一个虚拟环境。但现在当我尝试使用 Supervisorctl 命令启动 django 服务器时,它给出了“异常终止”错误。但在错误日志中,带有错误的完整跟踪如下:

Error: class uri 'simple' invalid or not found:

[Traceback (most recent call last):
File "/home/ubuntu/.virtualenvs/django16/lib/python3.2/site-packages/gunicorn/util.py", line 125, in load_class
section, uri)
File "/home/ubuntu/.virtualenvs/django16/lib/python3.2/site-packages/pkg_resources.py", line 378, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/ubuntu/.virtualenvs/django16/lib/python3.2/site-packages/pkg_resources.py", line 371, in get_distribution
if isinstance(dist,Requirement): dist = get_provider(dist)
File "/home/ubuntu/.virtualenvs/django16/lib/python3.2/site-packages/pkg_resources.py", line 243, in get_provider
return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
File "/home/ubuntu/.virtualenvs/django16/lib/python3.2/site-packages/pkg_resources.py", line 728, in require
needed = self.resolve(parse_requirements(requirements))
File "/home/ubuntu/.virtualenvs/django16/lib/python3.2/site-packages/pkg_resources.py", line 626, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: gunicorn

我尝试用谷歌搜索,但没有找到任何解决方案,所以有人可以帮助我吗?

答案1

已经很晚了,但我还是会添加解决方案。我也遇到了与 gunicorn 类似的问题,我通过使用env /bin/gunicorn而不是仅仅使用 来运行我的应用程序解决了这个问题gunicorn

相关内容