Python Pyramid - 环境设置



建议在安装有 Python 3.6 或更高版本的系统上安装 Pyramid 软件包。Pyramid 可以安装在 Linux、MacOS 和 Windows 平台上。安装它的最简单方法是使用 PIP 安装程序,最好在 Python 虚拟环境中使用。

pip3 install pyramid

虽然可以使用属于 wsgiref 模块一部分的内置 WSGI 开发服务器运行 Pyramid Web 应用程序,但建议不要在生产环境中使用。因此,我们还安装了 Waitress,一个生产级纯 Python WSGI 服务器(也是 Pylons 项目的一部分)。

pip3 install waitress

这将安装 Pyramid (2.0 版)、Waitress (2.1.2 版) 以及来自 Pylon 项目的其他依赖项,如 WebOb、PasteDeploy 等。要检查安装了哪些内容,请运行 pip freeze 命令。

pip3 freeze
hupper==1.10.3
PasteDeploy==2.1.1
plaster==1.0
plaster-pastedeploy==0.7
pyramid==2.0
translationstring==1.4
venusian==3.0.0
waitress==2.1.2
WebOb==1.8.7
zope.deprecation==4.4.0
zope.interface==5.4.0
广告
© . All rights reserved.