Python Pyramid 简明教程
Python Pyramid - Environment Setup
建议在已安装 Python 3.6 或更高版本的系统中安装 Pyramid 包。Pyramid 可安装在 Linux、MacOS 和 Windows 平台。安装它的最简单方法是使用 PIP 安装程序,最好在 Python 虚拟环境中进行。
It is recommended that the Pyramid package be installed on a system having Python 3.6 or above version installed. Pyramid can be installed on Linux, MacOS as well as Windows platform. Simplest way of installing it is by using PIP installer, preferably under a Python virtual environment.
pip3 install pyramid
尽管可以使用内置的 WSGI 开发服务器( wsgiref 模块的一部分)运行 Pyramid Web 应用程序,但不建议在生产环境中使用。因此,我们还安装了 Waitress,这是一款生产质量的纯 Python WSGI 服务器(也是 Pylons 项目的一部分)。
Although a Pyramid web application can be run using the built-in WSGI development server that is a part of the wsgiref module, it is not recommended for use in production environment. Hence, we also install Waitress, a production-quality pure-Python WSGI server (also a part of Pylons project).
pip3 install waitress
这将安装 Pyramid(版本 2.0)、Waitress(版本 2.1.2),以及 Pylon 项目的其他依赖项,例如 WebOb、PasteDeploy 等。要检查安装了哪些内容,请运行 pip freeze 命令。
This will install Pyramid (ver 2.0), Waitress (ver 2.1.2) in addition to other dependencies from Pylon project such that WebOb, PasteDeploy, and others. To check what gets installed, run pip freeze command.
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