Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

The Python programming language

License

NotificationsYou must be signed in to change notification settings

python/cpython

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CPython build status on GitHub ActionsCPython build status on Azure DevOpsPython Discourse chat

Copyright © 2001-2024 Python Software Foundation. All rights reserved.

See the end of this file for further copyright and license information.

For more complete instructions on contributing to CPython development,see theDeveloper Guide.

Installable Python kits, and information about using Python, are available atpython.org.

On Unix, Linux, BSD, macOS, and Cygwin:

./configuremakemake testsudo make install

This will install Python aspython3.

You can pass many options to the configure script; run./configure --helpto find out more. On macOS case-insensitive file systems and on Cygwin,the executable is calledpython.exe; elsewhere it's justpython.

Building a complete Python installation requires the use of variousadditional third-party libraries, depending on your build platform andconfigure options. Not all standard library modules are buildable orusable on all platforms. Refer to theInstall dependenciessection of theDeveloper Guide for current detailed information ondependencies for various Linux distributions and macOS.

On macOS, there are additional configure and build options relatedto macOS framework and universal builds. Refer toMac/README.rst.

On Windows, seePCbuild/readme.txt.

To build Windows installer, seeTools/msi/README.txt.

If you wish, you can create a subdirectory and invoke configure from there.For example:

mkdir debugcd debug../configure --with-pydebugmakemake test

(This will fail if youalso built at the top-level directory. You should doamake clean at the top-level first.)

To get an optimized build of Python,configure --enable-optimizationsbefore you runmake. This sets the default make targets up to enableProfile Guided Optimization (PGO) and may be used to auto-enable Link TimeOptimization (LTO) on some platforms. For more details, see the sectionsbelow.

PGO takes advantage of recent versions of the GCC or Clang compilers. If used,either viaconfigure --enable-optimizations or by manually runningmake profile-opt regardless of configure flags, the optimized buildprocess will perform the following steps:

The entire Python directory is cleaned of temporary files that may haveresulted from a previous compilation.

An instrumented version of the interpreter is built, using suitable compilerflags for each flavor. Note that this is just an intermediary step. Thebinary resulting from this step is not good for real-life workloads as it hasprofiling instructions embedded inside.

After the instrumented interpreter is built, the Makefile will run a trainingworkload. This is necessary in order to profile the interpreter's execution.Note also that any output, both stdout and stderr, that may appear at this stepis suppressed.

The final step is to build the actual interpreter, using the informationcollected from the instrumented one. The end result will be a Python binarythat is optimized; suitable for distribution or production installation.

Enabled via configure's--with-lto flag. LTO takes advantage of theability of recent compiler toolchains to optimize across the otherwisearbitrary.o file boundary when building final executables or sharedlibraries for additional performance gains.

We have a comprehensive overview of the changes in theWhat's New in Python3.13 document. For a moredetailed change log, readMisc/NEWS, but a fullaccounting of changes can only be gleaned from thecommit history.

If you want to install multiple versions of Python, see the section belowentitled "Installing multiple versions".

Documentation for Python 3.13 is online,updated daily.

It can also be downloaded in many formats for faster access. The documentationis downloadable in HTML, PDF, and reStructuredText formats; the latter versionis primarily for documentation authors, translators, and people with specialformatting requirements.

For information about building Python's documentation, refer toDoc/README.rst.

To test the interpreter, typemake test in the top-level directory. Thetest set produces some output. You can generally ignore the messages aboutskipped tests due to optional features which can't be imported. If a messageis printed about a failed test or a traceback or core dump is produced,something is wrong.

By default, tests are prevented from overusing resources like disk space andmemory. To enable these tests, runmake buildbottest.

If any tests fail, you can re-run the failing test(s) in verbose mode. Forexample, iftest_os andtest_gdb failed, you can run:

make test TESTOPTS="-v test_os test_gdb"

If the failure persists and appears to be a problem with Python rather thanyour environment, you canfile a bug report and include relevant output fromthat command to show the issue.

SeeRunning & Writing Testsfor more on running tests.

On Unix and Mac systems if you intend to install multiple versions of Pythonusing the same installation prefix (--prefix argument to the configurescript) you must take care that your primary python executable is notoverwritten by the installation of a different version. All files anddirectories installed usingmake altinstall contain the major and minorversion and can thus live side-by-side.make install also creates${prefix}/bin/python3 which refers to${prefix}/bin/python3.X. If youintend to install multiple versions using the same prefix you must decide whichversion (if any) is your "primary" version. Install that version usingmake install. Install all other versions usingmake altinstall.

For example, if you want to install Python 2.7, 3.6, and 3.13 with 3.13 being theprimary version, you would executemake install in your 3.13 build directoryandmake altinstall in the others.

SeePEP 719 for Python 3.13 release details.

Copyright © 2001-2024 Python Software Foundation. All rights reserved.

Copyright © 2000 BeOpen.com. All rights reserved.

Copyright © 1995-2001 Corporation for National Research Initiatives. Allrights reserved.

Copyright © 1991-1995 Stichting Mathematisch Centrum. All rights reserved.

See theLICENSE forinformation on the history of this software, terms & conditions for usage, and aDISCLAIMER OF ALL WARRANTIES.

This Python distribution containsno GNU General Public License (GPL) code,so it may be used in proprietary projects. There are interfaces to some GNUcode but these are entirely optional.

All trademarks referenced herein are property of their respective holders.


[8]ページ先頭

©2009-2025 Movatter.jp