PyPy

From ArchWiki
Revision as of 03:17, 21 December 2012 by Theoj (Talk | contribs) (EasyInstall Example + various edits)

Jump to: navigation, search

PyPy is an alternate implementation of the Python 2.7.2 interpreter. PyPy's benefits are in the area of speed, memory usage, sandboxing and stacklessness. It is compatible with Cpython with some exceptions.

Installation

Install the pypy package

pacman -S pypy

EasyInstall

Python libraries and programs can be installed in PyPy through EasyInstall. PyPy libraries are stored in a different folder then Cpython libraries.

EasyInstall Installation

EasyInstall does not come with the PyPy package and must be installed manually. Create the /opt/pypy/site-packages/ folder.

sudo mkdir /opt/pypy/site-packages/

Download distribute_setup.py to the folder /opt/pypy/ and run it. distribute_setup.py will install EasyInstall.

cd /opt/pypy/
sudo wget python-distribute.org/distribute_setup.py
sudo pypy distribute_setup.py

EasyInstall will be located at /opt/pypy/bin/easy_install

Installing EasyInstall Packages

To install EasyInstall package package_name into PyPy enter

sudo /opt/pypy/bin/easy_install package_name

Packages Will be Located at /opt/pypy/site-packages Installed libraries and applications will be at /opt/pypy/bin Programs installed through EasyInstall on PyPy can usually be ran with /opt/pypy/bin/program_name where program_name is the name of the PyPy program.

EasyInstall Package Example

The following will install the Lamson email framework. {{bc|sudo /opt/pypy/bin/easy_install lamson} The following will run the framework's gen-project option

/opt/pypy/bin/lamson gen -project testproject

See Also

PyPy website

Python