Copyright (c) 2001-2019 Python Software Foundation. All rights reserved.
See the end of this file for further copyright and license information.
Contents
- Website: https://www.python.org
- Source code: https://github.com/python/cpython
- Issue tracker: https://bugs.python.org
- Documentation: https://docs.python.org
- Developer's Guide: https://devguide.python.org/
For more complete instructions on contributing to CPython development, see the Developer Guide.
Installable Python kits, and information about using Python, are available at python.org.
On Unix, Linux, BSD, macOS, and Cygwin:
./configure make make test sudo make install
This will install Python as python3
.
You can pass many options to the configure script; run ./configure --help
to find out more. On macOS and Cygwin, the executable is called python.exe
;
elsewhere it's just python
.
If you are running on macOS with the latest updates installed, make sure to install OpenSSL or some other SSL software along with Homebrew or another package manager. If issues persist, see https://devguide.python.org/setup/#macos-and-os-x for more information.
On macOS, if you have configured Python with --enable-framework
, you
should use make frameworkinstall
to do the installation. Note that this
installs the Python executable in a place that is not normally on your PATH,
you may want to set up a symlink in /usr/local/bin
.
On Windows, see PCbuild/readme.txt.
If you wish, you can create a subdirectory and invoke configure from there. For example:
mkdir debug cd debug ../configure --with-pydebug make make test
(This will fail if you also built at the top-level directory. You should do
a make clean
at the top-level first.)
To get an optimized build of Python, configure --enable-optimizations
before you run make
. This sets the default make targets up to enable
Profile Guided Optimization (PGO) and may be used to auto-enable Link Time
Optimization (LTO) on some platforms. For more details, see the sections
below.
PGO takes advantage of recent versions of the GCC or Clang compilers. If used,
either via configure --enable-optimizations
or by manually running
make profile-opt
regardless of configure flags, the optimized build
process will perform the following steps:
The entire Python directory is cleaned of temporary files that may have resulted from a previous compilation.
An instrumented version of the interpreter is built, using suitable compiler flags for each flavour. Note that this is just an intermediary step. The binary resulting from this step is not good for real life workloads as it has profiling instructions embedded inside.
After the instrumented interpreter is built, the Makefile will run a training workload. This is necessary in order to profile the interpreter execution. Note also that any output, both stdout and stderr, that may appear at this step is suppressed.
The final step is to build the actual interpreter, using the information collected from the instrumented one. The end result will be a Python binary that is optimized; suitable for distribution or production installation.
Enabled via configure's --with-lto
flag. LTO takes advantage of the
ability of recent compiler toolchains to optimize across the otherwise
arbitrary .o
file boundary when building final executables or shared
libraries for additional performance gains.
We have a comprehensive overview of the changes in the What's New in Python 3.8 document. For a more detailed change log, read Misc/NEWS, but a full accounting of changes can only be gleaned from the commit history.
If you want to install multiple versions of Python, see the section below entitled "Installing multiple versions".
Documentation for Python 3.8 is online, updated daily.
It can also be downloaded in many formats for faster access. The documentation is downloadable in HTML, PDF, and reStructuredText formats; the latter version is primarily for documentation authors, translators, and people with special formatting requirements.
For information about building Python's documentation, refer to Doc/README.rst.