Installing IBM ZCodeScan on a distributed environment

IBM® ZCodeScan CLI is available in a Python installable format, which can be installed on Window, Linux, macOS or z/OS.

During the installation process, all the required dependencies are automatically installed by Python.

Install IBM ZCodeScan Python package

IBM ZCodeScan is provided as a Python package, so that it can be used on multiple operating systems. The package must be installed in Python for it to become functional. You can install the IBM ZCodeScan core package in a distributed environment (Windows, Linux® or macOS).

The installable files are wheel files. A wheel file is a ZIP-format archive with a specially formatted file name followed by the .whl extension. It contains a per-compiled Python module that is ready to install. The current Python versions support this installation method.

The directory where you unzipped zcodescan.tar contains a .whl file for each of the supported versions of Python.

The following table lists the IBM ZCodeScan .whl files, the environments where they can be used, and the corresponding versions of Python:
File names Execution environments Python versions
zcodescan-1.0.1.1-py3.13-none-any.whl Window, Linux, macOS or z/OS 3.13
zcodescan-1.0.1.1-py3.12-none-any.whl Window, Linux or macOS 3.12
zcodescan-1.0.1.1-py3.11-none-any.whl Window, Linux or macOS 3.11
Important: The Python wheel installation method performs version matching against the .whl file name. Any modification to the file name can break and corrupt the installation.

Create a Python virtual environment

We recommend that you create a virtual environment to isolate the Python package installation. You can then manage separate package installations for different projects and test the installations.
Note: You must run all the commands for Windows in the Windows command prompt.
  1. To create a virtual environment named IBM ZCodeScan in the /opt/pyenv directory, enter the following command:
    • Linux® or macOS
      python3 -m venv /opt/pyenv/zcodescan
    • Windows
      python.exe -m venv c:/opt/pyenv/zcodescan
  2. Next, you must activate the virtual environment with the following command:
    • Linux® or macOS:
      . /opt/pyenv/zcodescan/bin/activate
    • Windows
      c:\opt\pyenv\zcodescan\Scripts\activate
  3. Extract the installable files from zcodescan.tar by using the following command on Unix systems:
    tar xvf zcodescan.tar

    For Windows you can unzip the archive using the Window explorer native command.

Install the requisites

The directory where you unzipped zcodescan.tar contains a dependencies directory that contains all the upstream libraries needed for IBM ZCodeScan. In this directory give the following command:

  • Linux® or macOS
    python3 -m pip install --no-deps --no-cache-dir -r dependencies/requirements.txt --no-index --find-links dependencies
  • Windows
    python.exe -m pip install --no-deps --no-cache-dir -r dependencies/requirements.txt --no-index --find-links dependencies

Install IBM ZCodeScan

After Python has access to the requisite libraries, you can install IBM ZCodeScan.

Enter the following installation command, where X represents the Python version in the IBM ZCodeScan wheel file. For example, the wheel file can be zcodescan-1.0.1.1-py3.12-none-any.whl.

  • Linux® or macOS:
    python3 -m pip install --no-deps --no-cache-dir zcodescan-1.0.1.1-py3.X-none-any.whl
  • Windows
    python.exe -m pip install --no-deps --no-cache-dir zcodescan-1.0.1.1-py3.X-none-any.whl
Note: For Linux® or macOS, if you are not the administrator of the environment where you install the IBM ZCodeScan, and if you do not install IBM ZCodeScan in a virtual environment, the IBM ZCodeScan binary files are installed in your home folder ($HOME/.local/bin). In this case, before you validate the IBM ZCodeScan installation, you must add this folder to the PATH environment variable with the following command:
export PATH=$PATH:$HOME/.local/bin

Validate the IBM ZCodeScan installation

To verify if the IBM ZCodeScan command-line interface (CLI) module is correctly installed, trigger the help option with the following command:

zcodescan -h

The command must display the command arguments.