3. Налаштувати Python — Python 3.15.2 documentation
Навігація індекс модулі | наступний | попередній | Python » 3.15.2 documentation » Налаштування та використання Python » 3. Налаштувати Python | Theme | 3. Налаштувати Python ¶ 3.1. Build requirements ¶ To build CPython, you will need: A C11 compiler. Optional C11 features are not required. On Windows, Microsoft Visual Studio 2017 or later is required.
Support for IEEE 754 floating-point numbers and floating-point Not-a-Number (NaN) . Support for threads. Змінено в версії 3.5: On Windows, Visual Studio 2015 or later is now required. Змінено в версії 3.6: Selected C99 features, like <stdint.h> and static inline functions, are now required. Змінено в версії 3.7: Thread support is now required. Змінено в версії 3.11: C11 compiler, IEEE 754 and NaN support are now required.
On Windows, Visual Studio 2017 or later is required. See also PEP 7 «Style Guide for C Code» and PEP 11 «CPython platform support». 3.1.1. Requirements for optional modules ¶ Some optional modules of the standard library require third-party libraries installed for development (for example, header files must be available). Missing requirements are reported in the configure output. Modules that are missing due to missing dependencies are listed near the end of the make output, sometimes using an internal name, for example, _ctypes for ctypes module.
If you distribute a CPython interpreter without optional modules, it’s best practice to advise users, who generally expect that standard library modules are available. Dependencies to build optional modules are: Dependency Minimum version Python module libbz2 bz2 libffi 3.3.0 recommended ctypes liblzma lzma libmpdec 2.5.0 decimal [ 1 ] libreadline or libedit [ 2 ] readline libuuid _uuid [ 3 ] ncurses [ 4 ] curses OpenSSL [ 6 ] ssl , hashlib [ 5 ] SQLite 3.15.2 sqlite3 Tcl/Tk 8.5.12 tkinter , IDLE , turtle zlib 1.2.2.1 zlib , gzip , ensurepip zstd 1.4.5 compression.zstd Note that the table does not include all optional modules; in particular, platform-specific modules like winreg are not listed here.
Дивись також The devguide includes a full list of dependencies required to build all modules and instructions on how to install them on common platforms. --with-system-expat allows building with an external libexpat library. Options for third-party dependencies Змінено в версії 3.1: Tcl/Tk version 8.3.1 is now required for tkinter . Змінено в версії 3.5: Tcl/Tk version 8.4 is now required for tkinter .
Змінено в версії 3.7: OpenSSL 1.0.2 is now required for hashlib and ssl . Змінено в версії 3.10: OpenSSL 1.1.1 is now required for hashlib and ssl . SQLite 3.7.15 is now required for sqlite3 . Змінено в версії 3.11: Tcl/Tk version 8.5.12 is now required for tkinter . Змінено в версії 3.13: SQLite 3.15.2 is now required for sqlite3 . 3.2. Generated files ¶ To reduce build dependencies, Python source code contains multiple generated files.
Commands to regenerate all generated files: make regen-all make regen-stdlib-module-names make regen-limited-abi make regen-configure make regen-sbom make regen-unicodedata The Makefile.pre.in file documents generated files, their inputs, and tools used to regenerate them. Search for regen-* make targets. 3.2.1. configure script ¶ The make regen-configure command regenerates the aclocal.m4 file and the configure script using the Tools/build/regen-configure.sh shell script which uses an Ubuntu container to get the same tools versions and have a reproducible output.
The container is optional, the following command can be run locally: autoreconf -ivf -Werror The generated files can change depending on the exact versions of the tools used. The container that CPython uses has Autoconf 2.72, aclocal from Automake 1.16.5, and pkg-config 1.8.1. Змінено в версії 3.13: Autoconf 2.71 and aclocal 1.16.5 and are now used to regenerate configure . Змінено в версії 3.14: Autoconf 2.72 is now used to regenerate configure .
3.3. Configure options ¶ List all configure script options using: ./configure --help Дивіться також Misc/SpecialBuilds.txt у вихідному дистрибутиві Python. 3.3.1. General options ¶ --enable-loadable-sqlite-extensions ¶ Support loadable extensions in the _sqlite extension module (default is no) of the sqlite3 module. Перегляньте метод sqlite3.Connection.enable_load_extension() модуля sqlite3 .
Added in version 3.6. --disable-ipv6 ¶ Вимкніть підтримку IPv6 (увімкнено за замовчуванням, якщо підтримується), перегляньте модуль socket . --enable-big-digits =[15|30] ¶ Визначте розмір у бітах цифр Python int : 15 або 30 біт. By default, the digit size is 30. Define PYLONG_BITS_IN_DIGIT to 15 or 30 . Див. sys.int_info.bits_per_digit . --with-suffix =SUFFIX ¶ Установіть для виконуваного файлу Python суфікс SUFFIX .
The default suffix is .exe on Windows and macOS ( python.exe executable), .js on Emscripten node, .html on Emscripten browser, .wasm on WASI, and an empty string on other platforms ( python executable). Змінено в версії 3.11: The default suffix on WASM platform is one of .js , .html or .wasm . --with-tzpath =<list of absolute paths separated by pathsep> ¶ Select the default time zone search path for zoneinfo.TZPATH .
See the Compile-time configuration of the zoneinfo module. За замовчуванням: /usr/share/zoneinfo:/usr/lib/zoneinfo:/usr/share/lib/zoneinfo:/etc/zoneinfo . Дивіться роздільник шляхів os.pathsep . Added in version 3.9. --without-decimal-contextvar ¶ Створіть модуль розширення _decimal , використовуючи локальний контекст потоку, а не локальний контекст співпрограми (за замовчуванням), дивіться модуль decimal .
See decimal.HAVE_CONTEXTVAR and the contextvars module. Added in version 3.9. --with-dbmliborder =<list of backend names> ¶ Порядок перевизначення, щоб перевірити серверні частини бази даних для модуля dbm Дійсним значенням є розділений двокрапкою ( : ) рядок із іменами серверної частини: ndbm ; gdbm ; bdb . --without-c-locale-coercion ¶ Вимкнути приведення локалі C до локалі на основі UTF-8 (увімкнено за умовчанням).
Не визначайте макрос PY_COERCE_C_LOCALE . Перегляньте PYTHONCOERCECLOCALE і PEP 538 . --with-platlibdir =DIRNAME ¶ Ім’я каталогу бібліотеки Python (за замовчуванням – lib ). Fedora та SuSE використовують lib64 на 64-розрядних платформах. Перегляньте sys.platlibdir . Added in version 3.9. --with-wheel-pkg-dir =PATH ¶ Каталог пакетів коліс, які використовуються модулем ensurepip (за умовчанням немає).
Some Linux distribution packaging policies recommend against bundling dependencies. For example, Fedora installs wheel packages in the /usr/share/python-wheels/ directory and don’t install the ensurepip._bundled package. Added in version 3.10. --with-pkg-config =[check|yes|no] ¶ Whether configure should use pkg-config to detect build dependencies. check (default): pkg-config is optional yes : pkg-config is mandatory no : configure does not use pkg-config even when present Added in version 3.11. --with-missing-stdlib-config =FILE ¶ Path to a JSON configurati
The rest of this page is on the live site.