在 PyCharm 中的 运行 金字塔项目(专业版)中找不到方案 "file+ini "、协议 "wsgi" 的匹配加载程序

Could not find a matching loader for the scheme "file+ini ", protocol "wsgi" when running a Pyramid project in PyCharm (Professional version)

当我想在 PyCharm 中基于 Pyramid 服务器 运行 我的 Pyramid web 应用程序时,我收到了关于 'could not find a matching loader for the scheme' 的错误。但是,如果我在终端中直接 运行 pserve myapp.ini,它可以在本地启动我的网络应用程序。我在PyCharm中编辑了配置:配置文件指向myapp.ini,Python解释器指向虚拟环境中的python。

回溯(最近调用最后): 文件“/Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/pycharm_load_entry_point.py”,第 12 行,位于 sys.exit(f()) 文件“/Users/simon/Documents/venv/lib/python3.6/site-packages/pyramid/scripts/pserve.py”,第 34 行,在 main return command.run() 文件“/Users/simon/Documents/venv/lib/python3.6/site-packages/pyramid/scripts/pserve.py”,第 193 行,在 运行 中 装载机 = self._get_config_loader(config_uri) 文件“/Users/simon/Documents/venv/lib/python3.6/site-packages/pyramid/scripts/common.py”,第 23 行,在 get_config_loader 中 return plaster.get_loader(config_uri, 协议=['wsgi']) 文件“/Users/simon/Documents/venv/lib/python3.6/site-packages/plaster/loaders.py”,第 109 行,在 get_loader 中 提高 LoaderNotFound(requested_scheme,协议=协议) plaster.exceptions.LoaderNotFound: 找不到方案“file+ini”、协议“wsgi”的匹配加载程序。

进程已完成,退出代码为 1

虽然去官网看了plaster和wsgi,还是想不通

在 PyCharm 中配置 Pyramid web 应用程序时,有人有任何建议或有任何类似问题吗?

谢谢。

确保您已在 Run/Debug 配置中输入所有必需的值。

https://www.jetbrains.com/help/pycharm/run-debug-configuration.html#create-permanent

Create a run/debug configuration from a template

  1. Open the Run/Debug Configuration dialog in one of the following ways:

    • Select Run | Edit Configurations from the main menu.

    • With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector.

    • Press ⌃⌥R and then press 0.

  2. In the Run/Debug Configuration dialog, click + on the toolbar or press ⌘N. The list shows the run/debug configuration templates.

    Select the desired template. If you are not sure which template to choose, refer to Run/debug configurations dialog for more information on particular templates.

  3. Specify the run/debug configuration name in the Name field. This name will be shown in the list of the available run/debug configurations.

  4. [Omitted]

  5. Set the run/debug configuration parameters.

金字塔项目*所需的参数包括名称配置文件项目Python 解释器 工作目录。您需要添加 工作目录 .

*I don't know why they call it a "Pyramid server"。 Pyramid 是一个网络框架,而不是服务器。 Waitress 和 Werkzeug 是服务员。