Installing the Chilkat2 Python Module on Linux

How to add the Chilkat2 module to a Python installation on Linux (all architectures) and Alpine Linux, plus the checks that prevent the common version and architecture errors.

Examples: Chilkat2 Python Examples  ·  Documentation: Chilkat2 Python Reference

Easiest install: pip For Python 3.6 or later, you don't need this page — just install with pip:
pip3 install chilkat2
The steps below are for a manual install from the downloaded .tar.gz.
The download must match your system A compiled Python module only imports into a Python that matches it:
  • Python version — e.g. the 3.14 download for Python 3.14.
  • Architecturex86_64, x86, aarch64, or armhf.
  • C library — the standard Linux build for glibc, the Alpine build for musl. They are not interchangeable.
The included installChilkat.py verifies version, OS, and architecture for you.
  1. Download & unpack

    Get the build for your system from the Chilkat2 Linux Python Downloads (Linux and Alpine are both listed there), then unpack:

    tar xzf chilkat2-python-<version>-<arch>-linux.tar.gz
  2. What's in the download

    chilkat2-python-<version>-<arch>-linux/
    ├─ chilkat2.so             the compiled Chilkat2 module
    ├─ installChilkat.py       copies chilkat2.so into site-packages
    ├─ testChilkat.py          verifies the install
    ├─ license.pdf
    ├─ pcre2-license.pdf
    ├─ quickjs-license.pdf
    ├─ THIRD-PARTY-NOTICES.txt
    ├─ Linux                   empty marker: target operating system
    ├─ x86_64                  empty marker: target architecture
    └─ 3.14                    empty marker: target Python version

    The three empty marker files identify the OS, architecture, and Python version this download is built for. installChilkat.py reads them to confirm the download matches your Python before installing.

  3. Check your Python version and architecture

    python3 --version
    python3 -c "import platform; print(platform.machine())"
    uname -m

    Match the version to the download's marker (e.g. 3.14) and the architecture to platform.machine() (x86_64, aarch64, …).

    With multiple Pythons or a virtual environment, run the install and test with the exact interpreter you'll use (e.g. the venv's python3).
  4. Install into site-packages

    From the unpacked directory:

    python3 installChilkat.py            # per-user site-packages
    sudo python3 installChilkat.py -g    # global site-packages

    The script prints the detected Python version, system, and processor, refuses to install if the download doesn't match, then copies chilkat2.so into site-packages.

  5. Verify with testChilkat.py

    python3 testChilkat.py

    It imports chilkat2 and prints the version of several classes:

    Zip: 11.5.0
    IMAP: 11.5.0
    FTP: 11.5.0
    POP3/SMTP: 11.5.0
    ... (one line per class)
  6. Use Chilkat in your scripts

    Import chilkat2 and unlock once at startup (any string starts the 30-day trial; use your license code after purchase):

    import chilkat2
    
    glob = chilkat2.Global()
    success = glob.UnlockBundle("Anything for 30-day trial")
    if success != True:
        print(glob.LastErrorText)
    
    # ... use any Chilkat class, e.g. chilkat2.Http(), chilkat2.JsonObject(), ...

Notes for Alpine Linux

Use the Alpine download, which is built for musl libc — the standard Linux (glibc) build will not import on Alpine. All other steps are identical.

Common errors

“This Python version does not match the downloaded Chilkat module”

installChilkat.py found that your Python version differs from the download (the version marker file). Download the build matching python3 --version.

“ImportError” when importing chilkat2

Usually an architecture or C-library mismatch — e.g. an x86_64 module under a different architecture, or a glibc build on Alpine (musl). Re-check Step 3 and use the matching download.

“ModuleNotFoundError: No module named 'chilkat2'”

The module was installed into a different Python (or outside your virtual environment) than the one running your script. Install and run with the same interpreter, or use pip3 install chilkat2.

In a virtualenv: “module 'site' has no attribute 'getusersitepackages'” (or 'getsitepackages')

Some virtualenv site.py versions lack these functions. Use the alternate install script instead: installchilkat_virtenv.zip. If it still doesn't work, contact support@chilkatsoft.com.