Python- 金字塔没有 运行 本地主机

Python- pyramid doesn't run local host

我正在尝试安装 运行 python 金字塔。

我安装了anaconda,创建了一个虚拟环境并使用pip install "pyramid==1.7.3"安装了pyramid。

然后执行

   `from wsgiref.simple_server import make_server
    from pyramid.config import Configurator
    from pyramid.response import Response


    def hello_world(request):
        return Response('Hello %(name)s!' % request.matchdict)

    if __name__ == '__main__':
        config = Configurator()
        config.add_route('hello', '/hello/{name}')
        config.add_view(hello_world, route_name='hello')
        app = config.make_wsgi_app()
        server = make_server('0.0.0.0', 8080, app)
        server.serve_forever()`

这个helloworld.py。这不会启动服务器,当我在浏览器中打开 localhost:8080 时,它给了我一个 404 Not Found The resource could not be found. 错误。

这里是 Command Prompt

我在这里错过了什么?

对于 Python 中的 Web 应用程序开发新手,我建议完成 Quick Tutorial。不要跳过任何步骤,包括需求。它很好地概述了在 Python 及其生态系统中创建 Web 应用程序,并提供了进一步深入阅读的参考。

Anaconda 面向数据科学受众。在我们的文档中,我们没有提供有关如何在 Anaconda 中工作的具体说明,因此您必须自己学习该部分。

它在“http://localhost:8080/hello/world”投放,而不是在 'localhost:8080'