# pypy / pypy / doc / getting-started.rst

 David Malcolm 1e46012 2011-03-14 David Malcolm 47ed8f9 2011-03-16 David Malcolm 1e46012 2011-03-14 David Malcolm 47ed8f9 2011-03-16 David Malcolm 1e46012 2011-03-14 Carl Friedrich B… 5d1a7bd 2011-04-30 lac 1250ec0 2011-04-29 David Malcolm 1e46012 2011-03-14 lac 1250ec0 2011-04-29 David Malcolm 1e46012 2011-03-14 Dario Bertini 5d78885 2011-04-25 lac 1250ec0 2011-04-29 David Malcolm 1e46012 2011-03-14 Antonio Cuni f324f42 2011-04-29 Antonio Cuni 8146c72 2011-07-06 Antonio Cuni f324f42 2011-04-29 Maciej Fijalkows… 0cd89b0 2012-11-22 Antonio Cuni f324f42 2011-04-29 Maciej Fijalkows… 0cd89b0 2012-11-22 Antonio Cuni f324f42 2011-04-29 Antonio Cuni f07036d 2011-04-29 Antonio Cuni f324f42 2011-04-29 Antonio Cuni f07036d 2011-04-29 Antonio Cuni f324f42 2011-04-29 lac a8b6215 2011-08-19 Antonio Cuni f324f42 2011-04-29 Maciej Fijalkows… 0cd89b0 2012-11-22 Antonio Cuni f07036d 2011-04-29 Maciej Fijalkows… 0cd89b0 2012-11-22 Antonio Cuni f07036d 2011-04-29 Maciej Fijalkows… 0cd89b0 2012-11-22 Antonio Cuni f324f42 2011-04-29 Maciej Fijalkows… 0cd89b0 2012-11-22 Antonio Cuni f324f42 2011-04-29 lac ac095c2 2011-04-29 Antonio Cuni f324f42 2011-04-29 David Malcolm 1e46012 2011-03-14 Antonio Cuni f324f42 2011-04-29 David Malcolm 1e46012 2011-03-14 David Malcolm fc0e6b3 2011-03-16 David Malcolm 1e46012 2011-03-14 Alex Perry e820744 2011-03-14 David Malcolm 1e46012 2011-03-14 Antonio Cuni f324f42 2011-04-29 David Malcolm 1e46012 2011-03-14 Carl Friedrich B… 5d1a7bd 2011-04-30 David Malcolm 1e46012 2011-03-14 Carl Friedrich B… 5d1a7bd 2011-04-30 David Malcolm 1e46012 2011-03-14 Carl Friedrich B… 5d1a7bd 2011-04-30 David Malcolm 1e46012 2011-03-14 lac b6f5304 2011-04-29 David Malcolm 1e46012 2011-03-14 Carl Friedrich B… 5d1a7bd 2011-04-30 David Malcolm 1e46012 2011-03-14 Carl Friedrich B… 541308f 2011-04-27  1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 ================================== Getting Started ================================== .. contents:: .. _howtopypy: What is PyPy ? ============== In common parlance, PyPy has been used to mean two things. The first is the RPython translation toolchain_, which is a framework for generating dynamic programming language implementations. And the second is one particular implementation that is so generated -- an implementation of the Python_ programming language written in Python itself. It is designed to be flexible and easy to experiment with. This double usage has proven to be confusing, and we are trying to move away from using the word PyPy to mean both things. From now on we will try to use PyPy to only mean the Python implementation, and say the RPython translation toolchain_ when we mean the framework. Some older documents, presentations, papers and videos will still have the old usage. You are hereby warned. We target a large variety of platforms, small and large, by providing a compiler toolsuite that can produce custom Python versions. Platform, memory and threading models, as well as the JIT compiler itself, are aspects of the translation process - as opposed to encoding low level details into the language implementation itself. more..._ .. _Python: http://docs.python.org/reference/ .. _RPython translation toolchain: translation.html .. _more...: architecture.html Just the facts ============== Download a pre-built PyPy ------------------------- The quickest way to start using PyPy is to download a prebuilt binary for your OS and architecture. You can either use the most recent release_ or one of our development nightly build_. Please note that the nightly builds are not guaranteed to be as stable as official releases, use them at your own risk. .. _most recent release: http://pypy.org/download.html .. _development nightly build: http://buildbot.pypy.org/nightly/trunk/ Installing PyPy --------------- PyPy is ready to be executed as soon as you unpack the tarball or the zip file, with no need to install it in any specific location:: $tar xf pypy-2.0-beta1-linux.tar.bz2$ ./pypy-2.0-beta1/bin/pypy Python 2.7.3 (7e4f0faa3d51, Nov 22 2012, 10:35:18) [PyPy 2.0.0-beta1 with GCC 4.7.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. And now for something completely different: PyPy is an exciting technology that lets you to write fast, portable, multi-platform interpreters with less effort'' >>>> If you want to make PyPy available system-wide, you can put a symlink to the pypy executable in /usr/local/bin. It is important to put a symlink and not move the binary there, else PyPy would not be able to find its library. If you want to install 3rd party libraries, the most convenient way is to install distribute_ and pip_: $curl -O http://python-distribute.org/distribute_setup.py$ curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py $./pypy-2.0-beta1/bin/pypy distribute_setup.py$ ./pypy-2.0-beta1/bin/pypy get-pip.py $./pypy-2.0-beta1/bin/pip install pygments # for example 3rd party libraries will be installed in pypy-2.0-beta1/site-packages, and the scripts in pypy-2.0-beta1/bin. Installing using virtualenv --------------------------- It is often convenient to run pypy inside a virtualenv. To do this you need a recent version of virtualenv -- 1.6.1 or greater. You can then install PyPy both from a precompiled tarball or from a mercurial checkout:: # from a tarball$ virtualenv -p /opt/pypy-c-jit-41718-3fb486695f20-linux/bin/pypy my-pypy-env # from the mercurial checkout \$ virtualenv -p /path/to/pypy/pypy/translator/goal/pypy-c my-pypy-env Note that bin/python is now a symlink to bin/pypy. .. _distribute: http://www.python-distribute.org/ .. _pip: http://pypi.python.org/pypi/pip Clone the repository -------------------- If you prefer to compile PyPy by yourself_, or if you want to modify it, you will need to obtain a copy of the sources. This can be done either by downloading them from the download page_ or by checking them out from the repository using mercurial. We suggest using mercurial if one wants to access the current development. .. _downloading them from the download page: http://pypy.org/download.html You must issue the following command on your command line, DOS box, or terminal:: hg clone http://bitbucket.org/pypy/pypy pypy This will clone the repository and place it into a directory named pypy, and will get you the PyPy source in pypy/pypy and documentation files in pypy/pypy/doc. We try to ensure that the tip is always stable, but it might occasionally be broken. You may want to check out our nightly tests:_ find a revision (12-chars alphanumeric string, e.g. "963e808156b3") that passed at least the {linux32} tests (corresponding to a + sign on the line success) and then, in your cloned repository, switch to this revision using:: hg up -r XXXXX where XXXXX is the revision id. .. _compile PyPy by yourself: getting-started-python.html .. _our nightly tests:: http://buildbot.pypy.org/summary?branch= Where to go from here ====================== After you successfully manage to get PyPy's source you can read more about: - Building and using PyPy's Python interpreter_ - Learning more about the RPython toolchain and how to develop (with) PyPy_ - Tutorial for how to write an interpreter with the RPython toolchain and make it fast_ - Look at our benchmark results_ .. _Building and using PyPy's Python interpreter: getting-started-python.html .. _Learning more about the RPython toolchain and how to develop (with) PyPy: getting-started-dev.html .. _Tutorial for how to write an interpreter with the RPython toolchain and make it fast: http://morepypy.blogspot.com/2011/04/tutorial-writing-interpreter-with-pypy.html .. _Look at our benchmark results: http://speed.pypy.org .. _setuptools: http://pypi.python.org/pypi/setuptools Understanding PyPy's architecture --------------------------------- For in-depth information about architecture and coding documentation head over to the documentation section_ where you'll find lots of interesting information. Additionally, in true hacker spirit, you may just start reading sources_ . .. _documentation section: index.html#project-documentation .. _start reading sources: getting-started-dev.html#start-reading-sources Filing bugs or feature requests ------------------------------- You may file bug reports_ on our issue tracker which is also accessible through the 'issues' top menu of the PyPy website. Using the development tracker_ has more detailed information on specific features of the tracker. .. _Using the development tracker: coding-guide.html#using-development-tracker .. _bug reports: https://codespeak.net/issue/pypy-dev/ .. include:: _ref.txt 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.