As of this writing, Pyramid has been tested under Python 2.5.5,
Python 2.6.6, and Python 2.7.2. Pyramid does not run under any
version of Python before 2.5, and does not yet run under Python 3.X.

Pyramid is known to run on all popular Unix-like systems such as
Linux, MacOS X, and FreeBSD as well as on Windows platforms. It is also
known to run on Google’s App Engine, PyPy (1.5), and Jython
(2.5.2).

Pyramid installation does not require the compilation of any
C code, so you need only a Python interpreter that meets the
requirements mentioned.

If your system doesn’t have a Python interpreter, and you’re on UNIX,
you can either install Python using your operating system’s package
manager or you can install Python from source fairly easily on any
UNIX system that has development tools.

It’s useful to use a Python interpreter that isn’t the “system”
Python interpreter to develop your software. The authors of
Pyramid tend not to use the system Python for development
purposes; always a self-compiled one. Compiling Python is usually
easy, and often the “system” Python is compiled with options that
aren’t optimal for web development.

To compile software on your UNIX system, typically you need
development tools. Often these can be installed via the package
manager. For example, this works to do so on an Ubuntu Linux system:

If your Windows system doesn’t have a Python interpreter, you’ll need
to install it by downloading a Python 2.6-series interpreter
executable from python.org’s download section (the files labeled “Windows
Installer”). Once you’ve downloaded it, double click on the
executable and accept the defaults during the installation process.
You may also need to download and install the Python for Windows
extensions.

Warning

After you install Python on Windows, you may need to add the
C:\Python26 directory to your environment’s Path in order
to make it possible to invoke Python from a command prompt by
typing python. To do so, right click MyComputer, select
Properties –> AdvancedTab –> EnvironmentVariables
and add that directory to the end of the Path environment
variable.

It is best practice to install Pyramid into a “virtual”
Python environment in order to obtain isolation from any “system”
packages you’ve got installed in your Python version. This can be
done by using the virtualenv package. Using a virtualenv will
also prevent Pyramid from globally installing versions of
packages that are not compatible with your system Python.

To set up a virtualenv in which to install Pyramid, first
ensure that setuptools is installed. Invoke importsetuptools within the Python interpreter you’d like to run
Pyramid under:

If running importsetuptools does not raise an ImportError, it
means that setuptools is already installed into your Python
interpreter. If importsetuptools fails, you will need to install
setuptools manually. Note that above we’re using a Python 2.6-series
interpreter on Mac OS X; your output may differ if you’re using a
later Python version or a different platform.

If you are using a “system” Python (one installed by your OS
distributor or a 3rd-party packager such as Fink or MacPorts), you can
usually install the setuptools package by using your system’s package
manager. If you cannot do this, or if you’re using a self-installed
version of Python, you will need to install setuptools “by hand”.
Installing setuptools “by hand” is always a reasonable thing to do,
even if your package manager already has a pre-chewed version of
setuptools for installation.

To install setuptools by hand, first download ez_setup.py then invoke it
using the Python interpreter into which you want to install
setuptools.

$ python ez_setup.py

Once this command is invoked, setuptools should be installed on your
system. If the command fails due to permission errors, you may need
to be the administrative user on your system to successfully invoke
the script. To remediate this, you may need to do:

Once you’ve got setuptools installed, you should install the
virtualenv package. To install the virtualenv package
into your setuptools-enabled Python interpreter, use the
easy_install command.

$ easy_install virtualenv

This command should succeed, and tell you that the virtualenv package
is now installed. If it fails due to permission errors, you may need
to install it as your system’s administrative user. For example:

Using --no-site-packages when generating your virtualenv is very
important. This flag provides the necessary isolation for running the set of
packages required by Pyramid. If you do not specify
--no-site-packages, it’s possible that Pyramid will not install
properly into the virtualenv, or, even if it does, may not run properly,
depending on the packages you’ve already got installed into your Python’s
“main” site-packages dir.

Warning

If you’re on UNIX, do not use sudo to run the
virtualenv script. It’s perfectly acceptable (and desirable)
to create a virtualenv as a normal user.

You should perform any following commands that mention a “bin”
directory from within the env virtualenv dir.

Install the Python for Windows extensions. Make sure to
pick the right download for Python 2.6 and install it using the
same Python installation from the previous step.

Install latest setuptools distribution into the Python you
obtained/installed/found in the step above: download ez_setup.py and run it using
the python interpreter of your Python 2.6 installation using a
command prompt:

c:\> c:\Python26\python ez_setup.py

Use that Python’s bin/easy_install to install virtualenv:

c:\> c:\Python26\Scripts\easy_install virtualenv

Use that Python’s virtualenv to make a workspace:

c:\> c:\Python26\Scripts\virtualenv --no-site-packages env

Switch to the env directory:

c:\> cd env

(Optional) Consider using Scripts\activate.bat to make your shell
environment wired to use the virtualenv.

Use easy_install pointed at the “current” index to get
Pyramid and its direct dependencies installed:

Pyramid is known to work under Jython version 2.5.1.
Install Jython, and then follow the installation steps for
Pyramid on your platform described in one of the sections
entitled Installing Pyramid on a UNIX System or Installing Pyramid on a Windows System above,
replacing the python command with jython as necessary. The
steps are exactly the same except you should use the jython
command name instead of the python command name.

One caveat exists to using Pyramid under Jython: the Chameleon
templating engine does not work on Jython. However, the Mako
templating system, which is also included with Pyramid, does work under
Jython; use it instead.