Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
pyramid.pdf
Скачиваний:
10
Добавлен:
24.03.2015
Размер:
3.82 Mб
Скачать

CHAPTER

TWO

INSTALLING PYRAMID

2.1 Before You Install

You will need Python version 2.6 or better to run Pyramid.

Python Versions

As of this writing, Pyramid has been tested under Python 2.6.6, Python 2.7.2, and Python 3.2. Pyramid does not run under any version of Python before 2.6.

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 PyPy (1.6+).

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

2.1.1 If You Don’t Yet Have A Python Interpreter (UNIX)

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.

21

2. INSTALLING PYRAMID

Package Manager Method

You can use your system’s “package manager” to install Python. Every system’s package manager is slightly different, but the “flavor” of them is usually the same.

For example, on an Ubuntu Linux system, to use the system package manager to install a Python 2.6 interpreter, use the following command:

$ sudo apt-get install python2.6-dev

Once these steps are performed, the Python interpreter will usually be invokable via python2.6 from a shell prompt.

Source Compile Method

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 selfcompiled 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:

$ sudo apt-get install build-essential

On Mac OS X, installing XCode has much the same effect.

Once you’ve got development tools installed on your system, you can install a Python 2.6 interpreter from source, on the same system, using the following commands:

[chrism@vitaminf ~]$ cd ~ [chrism@vitaminf ~]$ mkdir tmp [chrism@vitaminf ~]$ mkdir opt [chrism@vitaminf ~]$ cd tmp [chrism@vitaminf tmp]$ wget \

http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz [chrism@vitaminf tmp]$ tar xvzf Python-2.6.4.tgz [chrism@vitaminf tmp]$ cd Python-2.6.4

[chrism@vitaminf Python-2.6.4]$ ./configure \ --prefix=$HOME/opt/Python-2.6.4

[chrism@vitaminf Python-2.6.4]$ make; make install

Once these steps are performed, the Python interpreter will be invokable via $HOME/opt/Python-2.6.4/bin/python from a shell prompt.

22

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]