.PYD

Файл PYD

Python extension module (Windows)
Задать вопрос
БЫСТРЫЙ ОТВЕТ

A .pyd file is a compiled Python extension module for Windows - technically a DLL containing native C/C++ code that Python imports like a regular module. You do not open it directly; Python loads it automatically when you use a package that needs it. If you see an "ImportError: DLL load failed" error, reinstall the package with pip for your exact Python version and architecture.

Разработчик: Python Software Foundation (CPython); built on Microsoft's PE/DLL format Категория: Файлы разработчика Открыть стандартное MIME: application/octet-stream
ОТКРЫВАЕТСЯ НА Windows
Связанные: .DO · .MD · .HEX · .XSD

На этой странице

Проиндексировано расширений: 19k+
Последняя проверка: Jun 29, 2026

Не знаете, что это за файл?

Перетащите любой файл в наш идентификатор - мы прочитаем первые байты, чтобы определить формат.

Идентифицировать файл

Что такое формат файла PYD?

Python dynamic modules are saved as .pyd files on Windows systems. A .pyd file is a Windows DLL in PE (Portable Executable) binary format, distinguished by exporting a PyInit_<modulename> entry point that the interpreter calls on import. .pyd modules contain libraries that can be used by other Python applications; dynamic libraries allow faster code loading and application modularity. In contrast to .pyc and .pyo bytecode files, .pyd files are specific to Windows - the .so format serves the same role on Linux and macOS.

.pyd files contain compiled Python extension modules. Modules contain one or more namespaces, and Python programs that use such modules can refer to functions in those modules. Modules can be used by multiple Python applications. Modern builds include an ABI tag in the filename - for example, cp312-win_amd64.pyd - locking the file to a specific CPython version and bitness. Creating and distributing .pyd modules is typically handled by build tools such as Cython or setuptools.

Безопасность и защита

РИСК: MEDIUM

A .pyd is native executable code that Python runs in-process with no sandbox, so a malicious .pyd can do anything your Python program can. The practical risks: (1) a .pyd dropped into a folder Python searches can hijack an import (DLL/PYD search-order hijacking), and (2) downloading individual .pyd files from random sites to "fix" an error is a malware vector - always reinstall the proper package from PyPI with pip instead. .pyd files inside legitimate pip-installed packages are normal. Treat an unexpected, unsigned .pyd in Downloads or a project folder with suspicion and scan it.

Детали формата

в двух словах
ПОЛНОЕ НАЗВАНИЕPython extension module (Windows)также известен как Python dynamic module, Compiled Python extension
РАЗРАБОТЧИКPython Software Foundation (CPython); built on Microsoft's PE/DLL formatс Late 1990s - Python on Windows has loaded extension modules from .pyd (a renamed .dll) since the Python 1.x/2.0 era
MIME-ТИПapplication/octet-stream
ТИПWindows PE (Portable Executable) DLL exposing a Python init function - compiled binary
СТАНДАРТОткрытый · без роялти
СВЯЗАННЫЕ.do.md.hex.xsd
MAGIC BYTES · СИГНАТУРА ФАЙЛА
СМЕЩЕНИЕ
0001
HEX
4D5A
ASCII
MZ
A .pyd is literally a Windows DLL, so it begins with the MZ DOS stub and contains a "PE\0\0" (50 45 00 00) signature at the offset stored in e_lfanew (0x3C). It differs from an ordinary DLL only in that it exports a Python module-init function named PyInit_<modulename> (Python 3) or init<modulename> (Python 2). The DLL flag (bit 0x2000) is set in the COFF Characteristics field.

Программы, открывающие файлы PYD

Windows4 apps
Python (CPython) - the loader Открытый код You don't open a .pyd directly. Python imports it: 'import modulename'. If it fails, reinstall the owning package: 'pip install --force-reinstall packagename'.
pip (package manager) Открытый код Reinstall/repair the package the .pyd belongs to for your exact Python version: 'pip install --upgrade --force-reinstall packagename'. Don't move .pyd files by hand.
Dependencies (lucasg) Открытый код Diagnose 'DLL load failed': open the .pyd to see which dependent DLLs (e.g. a VC++ runtime) are missing on the system.
Ghidra Открытый код For developers/reverse-engineers only: import the .pyd for full disassembly/decompilation of its native code (it's a PE binary).

Технические подробности

глубокая спецификация
Container formatWindows PE (Portable Executable) - the same binary container as `.dll` and `.exe` files
Magic bytes`MZ` (0x4D 0x5A) at offset 0 (DOS stub); PE signature at the offset stored at 0x3C
Byte orderLittle-endian
Key exported symbol`PyInit_<modulename>` (Python 3) or `init<modulename>` (Python 2) - CPython's import system calls this function to initialize the module
ABI filename tagVersion-tagged builds use the pattern `name.cpXYZ-win_amd64.pyd`; for example `cp312-win_amd64` targets CPython 3.12 on 64-bit Windows
PlatformWindows only; the Linux and macOS equivalent is a `.so` shared object
MIME type`application/octet-stream`; also registered as `application/vnd.microsoft.portable-executable`
Typical file size20 KB - several MB; large native libraries (e.g., NumPy or SciPy components) can reach tens of MB
CompressionNone - raw PE sections, no built-in compression
Code signingOptional Authenticode (PE) digital signature; integrity is otherwise unverified (native machine code)
Interpreter compatibilityMust match the exact CPython version, bitness (32/64-bit), and ABI tag; a mismatched file raises `ImportError` on import
Build toolchainTypically compiled from C, C++, or Cython source via setuptools `ext_modules`, CMake/scikit-build, or CFFI
ВыпущенLate 1990s - Python on Windows has loaded extension modules from .pyd (a renamed .dll) since the Python 1.x/2.0 era
Последняя версияTracks CPython; the per-version ABI tag (e.g. cp312-win_amd64) determines compatibility, current CPython 3.13 (2024)
Открыть стандартноеДа · без роялти
Спецификацияdocs.python.org

Конвертации PYD

Вопросы и ответы сообщества

спрошено пользователями
Задать быстрый вопрос
Получите помощь от людей, работающих с файлами PYD. Будьте конкретны - укажите вашу систему и версию ПО.
Аккаунт не нужен · ответы обычно в течение дня

Вопросов пока нет - станьте первым, кто спросит о файлах PYD.

Часто задаваемые вопросы

What is a .pyd file?
A compiled Python extension module for Windows - technically a DLL containing native (usually C/C++) code that Python can import like an ordinary module. It's how fast packages such as NumPy ship their compiled parts.
How do I open a .pyd file?
You don't open it directly - it's compiled binary, not a script. Python loads it automatically when you import a package that uses it. To inspect it, a developer can disassemble it with Ghidra; to fix it, reinstall the owning package with pip.
How do I fix 'ImportError: DLL load failed' for a .pyd?
Usually the package was built for a different Python version/architecture, is missing a dependent runtime (install the Microsoft Visual C++ Redistributable), or is corrupt. Reinstall it for your exact Python: 'pip install --force-reinstall packagename', and make sure your Python bitness matches the package.
Is a .pyd the same as a DLL?
Yes - a .pyd uses the identical Windows PE/DLL format. The only difference is that a .pyd exports a Python module-init function (PyInit_<name>), which is what lets Python import it as a module.
Can I convert a .pyd to .py source code?
No. A .pyd is compiled machine code; the original Python/C source can't be recovered, only roughly disassembled. Get the source from the package's official repository instead.
Is a .pyd file a virus?
Not inherently - most .pyd files are legitimate parts of installed Python packages. But because it's native code Python runs without a sandbox, treat an unexpected .pyd (especially one downloaded to 'fix' an error) with suspicion; install packages only from PyPI via pip and scan unknown files.

Ссылки

1Python docs - Building C and C++ Extensions on Windowsdocs.python.org
2Python docs - Extending Python with C or C++docs.python.org

Узнать больше

по всей базе данных

Популярные расширения на этой неделе

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.BINCD/DVD Disc Image (BIN/CUE)
6.EXEWindows Executable (Portable Executable)
7.RPMSGRestricted Permission Message
8.NOMEDIAAndroid No-Media Marker File
9.MDMarkdown Document
10.TXTPlain Text File

Похожие расширения

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Бесплатные инструменты для файлов

Идентификатор файлов и конвертер изображений в браузере - все работает на вашем устройстве.

Открыть инструменты

Обзор расширений файлов A-Z