Pyarmor requires shared Python runtime library and C library.
In Linux, please install shared Python runtime library when needed. For example, install Python 3.10 shared runtime library:
$ apt install libpython3.10
In Darwin, make sure the file
X.Y stands for Python major and minor version.
@rpath is one of:
If there is no this file, please install necessary packages or re-build Python with enable shared option, or using install_name_tool to adapt current Python installation, refer to ../question.
On Linux or MacOS, you should open your terminal and run the following command:
$ pip install pyarmor
On Windows, you should open Command Prompt (Win-r and type cmd) and run the same command:
C:\> pip install pyarmor
After installation, type pyarmor --version on the command prompt. If everything worked fine, you will see the version number for the Pyarmor package you just installed.
If you need generate obfuscated scripts to run in other platforms, install the corresponding packages:
$ pip install pyarmor.cli.core.windows $ pip install pyarmor.cli.core.themida $ pip install pyarmor.cli.core.linux $ pip install pyarmor.cli.core.darwin $ pip install pyarmor.cli.core.freebsd $ pip install pyarmor.cli.core.android
Not all the platforms are supported, more information check Building Environments
$ pip install pyarmor.cli
pyarmor is the main command to do everything. See Man Page.
pyarmor-7 is used to call old commands, it equals bug fixed Pyarmor 7.x
pyarmor-auth used by Group License to support unlimited docker containers
pyarmor is same as the following command:
$ python -m pyarmor.cli
When installing Pyarmor using pip, use virtual environments which could isolate the installed packages from the system packages, thus removing the need to use administrator privileges. To create a virtual environment in the
.venv directory, use the following command:
$ python -m venv .venv
You can read more about them in the Python Packaging User Guide.
Deprecated since version 8.2.9.
$ git clone https://github.com/dashingsoft/pyarmor $ cd pyarmor $ pip install .
Do not use this method, it may not work since v8.2.9
All the Pyarmor pacakges are published in the PyPI, download them and copy to offlice device.
For example, install offline Pyarmor 8.2.9 in Linux for Python 3.10:
$ pip install pyarmor.cli.core-3.2.9-cp310-none-manylinux1_x86_64.whl $ pip install pyarmor-8.2.9.zip
In Android or FreeBSD, there is no wheel in
pyarmor.cli.core, it should install source distribution and extra package
pyarmor.cli.core.freebsd. For example, install offline Pyarmor in Android for Python 3.10:
$ pip install pyarmor.cli.core-3.2.9.zip $ pip install pyarmor.cli.core.android-3.2.9-cp310-none-any.whl $ pip install pyarmor-8.2.9.zip
If need cross platform obfuscation, also install the corresponding platform package
For example, if need Themida protection, then install themida package:
$ pip install pyarmor.cli.themida-3.2.9-cp310-none-any.whl
In Linux to generate for Windows, install windows package:
$ pip install pyarmor.cli.windows-3.2.9-cp310-none-any.whl
$ pip install pyarmor.cli-8.2.9.zip
Create a script
tool.py, pass arguments by yourself
from pyarmor.cli.__main__ import main_entry args = ['gen', 'foo.py'] main_entry(args)
Run it by Python interpreter:
$ python tool.py
Run the following commands to make a clean uninstallation:
$ pip uninstall pyarmor $ pip uninstall pyarmor.cli.core $ pip uninstall pyarmor.cli.runtime $ pip uninstall pyarmor.cli.core.windows $ pip uninstall pyarmor.cli.core.themida $ pip uninstall pyarmor.cli.core.linux $ pip uninstall pyarmor.cli.core.darwin $ pip uninstall pyarmor.cli.core.freebsd $ pip uninstall pyarmor.cli.core.android $ rm -rf ~/.pyarmor $ rm -rf ./.pyarmor
~ may be different when logging by different user.
$HOME is home path of current logon user, check the environment variable
HOME to get the real path.