Registry / auth-security / pyarmor

pyarmor

JSON →
library9.2.7pypypi✓ verified 24d ago

Pyarmor is a command-line tool designed for obfuscating Python scripts, binding them to specific machines, and setting expiration dates. It focuses on protecting intellectual property by making Python source code difficult to reverse engineer while maintaining functionality. The library is actively maintained with frequent updates and new features, with its current version being 9.2.4.

pip install pyarmor
INSTALL
IMPORT
SIG · PYARMOR
P
pyarmor
auth-securitypythonv9.2.7
Install
2.0s avg
Import
Disk
26MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.2.7 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 28.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.0s · import 0.000s · 29MB
26MB installed
● package 26MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

pyarmor
import pyarmor
from pyarmor import __pyarmor__

Obfuscate a Python script named `foo.py` and then run the obfuscated version located in the `dist` directory. This command creates `dist/foo.py` and an essential `pyarmor_runtime` package (or `pytransform` in older versions) that must be distributed with the obfuscated script.

pyarmor gen foo.py python dist/foo.py
pyarmor --version
Debug
Known issues
breakingPyarmor 9.0+ introduced significant changes to licensing for CI/CD pipelines. Pyarmor Pro licenses can no longer be used in CI/CD, requiring a new Pyarmor CI license. Basic licenses need an extra CI regfile. Users upgrading Group Licenses must regenerate device regfiles.
fix
Review Pyarmor 9.0 upgrade notes on official documentation. For CI/CD, consider obtaining a Pyarmor CI license or updating existing license configurations (e.g., regfiles for Group License).
affects: 9.0.0 and later
gotchaObfuscated scripts, especially those utilizing C extensions (`_pytransform`), are often platform and Python version-dependent. Running scripts obfuscated with one Python version (e.g., 3.8) on a different version (e.g., 3.7 or 3.9) can lead to crashes or 'Marshal loads failed' errors.
fix
Always run obfuscated scripts with the exact Python version and platform (architecture, OS) that was used to obfuscate them. Use `--platform` option for cross-platform obfuscation if pre-built runtimes are available for the target.
affects: All versions
gotchaThe `pyarmor_runtime` package (or `pytransform` in older versions) and the `license.lic` file are crucial runtime dependencies. Failing to distribute these files with your obfuscated scripts, or placing them where Python cannot find them, will result in runtime errors such as `NameError: name '__pyarmor__' is not defined` or `Could not find _pytransform`.
fix
Ensure that the entire `dist` directory content (including `pyarmor_runtime` and `license.lic`) is distributed. Verify that `pyarmor_runtime` is in Python's import path on the target system. When using tools like PyInstaller, ensure they correctly bundle these runtime files.
affects: All versions
gotchaStarting with Pyarmor 9.2.2, default encoding for configuration files (`pyarmor cfg`) and project rule files changed to `utf-8`. Older configurations might implicitly rely on locale-specific encodings, potentially causing issues when reading or writing these files with the updated version.
fix
Manually ensure all existing configuration and project rule files are explicitly encoded as `utf-8` or convert them if issues arise. Review file content for non-UTF-8 characters if problems persist.
affects: 9.2.2 and later
gotchaCertain advanced obfuscation modes (e.g., BCC, RFT, `--mix-str`) have historically encountered issues, including script crashes on specific Python versions (e.g., Python 3.9+, 3.12, 3.13) or platforms. While fixes are often released in subsequent patches, aggressive obfuscation can introduce subtle runtime bugs.
fix
Thoroughly test obfuscated scripts across all target Python versions and platforms, especially when using advanced obfuscation modes. If crashes occur, try disabling the most aggressive modes or check for the latest Pyarmor patches that address specific Python version compatibility issues. Refer to `When Things Go Wrong` section in documentation for troubleshooting.
affects: Various, depending on specific mode and Python version
Upgrade
Version history
9.2.7latest on PyPI · released Aug 29, 2026
Audit
Dependencies
PyInstalleroptionalCommonly used with Pyarmor to package obfuscated scripts and their runtime dependencies into a single executable for distribution.
Agent activity
94 hits · last 30 days
node
90
OpenAI (training)
1
Resources
pyarmor — pip install pyarmor · libregistry