Python Package for macOS/Linux/Windows#

Generate SSH Key#

ANLT Utility requires an SSH key pair to run as a SSH service. To generate a SSH key pair, please open Command Prompt/PowerShell (Windows) or Terminal (macOS/Linux)

> ssh-keygen -t rsa

You will be prompted to save and name the key.

> Generating public/private rsa key pair. Enter file in which to save the key (/Users/USER/.ssh/id_rsa):

Press Enter to use the default name id_rsa.

Important

The filename of the key should be id_rsa. Please don’t use other filenames otherwise the application won’t be able to run.

Next you will be asked to create and confirm a passphrase for the key:

> Enter passphrase (empty for no passphrase):

Press Enter to skip passphrase.

> Enter same passphrase again:

Press Enter again to confirm passphrase.

This will generate two files, by default called id_rsa and id_rsa.pub in /Users/USER/.ssh

See also

You can read more about Generating SSH Key

Python Package for Win/macOS/Linux#

Note

Skip this section, if you are a Windows (x64) user and don’t want to install ANLT Utility as a Python package but simply want the .exe application,

ANLT Utility is available to install via the Python Package Index. You can also install from the source file. The steps below will guide you through

Prerequisites#

Before installing ANLT Utility, please make sure your environment has installed:

Install Python#

Important

ANLT Utility requires Python >= 3.8.

ANLT Utility requires that you download and install Python3 on your system.

Note

If you use Windows, remember to check Add python.exe to PATH.

../../_images/python_installation.png

After installation, open Command Prompt (Windows) or Terminal (macOS/Linux) and type python to verify your Python installation.

Check Python installation in Windows.#
> python
Python 3.10.10 (tags/v3.10.10:878ead1, Feb  7 2023, 16:38:35) [MSC v.1934 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
Check Python installation in macOS/Linux.#
$ python3
Python 3.10.10 (v3.10.10:a58ebcc701, Feb 7 2023, 14:50:16) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>

Note

🧐 If you are stuck with Python installation, seek help in Python 3 Installation & Setup Guide

Install PIP#

Make sure pip is installed on your system. pip is the package installer for Python . You can use it to install packages from the Python Package Index and other indexes.

Usually, pip is automatically installed if you are:

If you don’t have pip installed, you can:

Install pip in Windows environment.#
> py get-pip.py
Install pip in macOS/Linux environment.#
$ python3 get-pip.py

See also

Read more details about this script in pypa/get-pip.

Read more about installation of pip in pip installation.

Install From PyPi Repository#

pip is the recommended installer for ANLT Utility. The most common usage of pip is to install from the Python Package Index using Requirement Specifiers.

Note

If you install ANLT Utility using pip install xoa-utils, XOA Python API (PyPI package name xoa_driver) will be automatically installed.

Important

You can either install xoa-utils in your global Python namespace/package inventory or you can create a virtual Python environment to prevent polluting your global Python package inventory

If Install To Global Namespace#

Install ANLT Utility in Windows environment from PyPI.#
> pip install xoa-utils            # latest version
> pip install xoa-utils==1.0.0     # specific version
> pip install xoa-utils>=1.0.0     # minimum version
Install ANLT Utility in macOS/Linux environment from PyPI.#
$ pip install xoa-utils            # latest version
$ pip install xoa-utils==1.0.0     # specific version
$ pip install xoa-utils>=1.0.0     # minimum version

If Install To Virtual Environment#

Install ANLT Utility in a virtual environment, so it does not pollute your global namespace.

For example, your project folder is called /my_xoa_project.

Install ANLT Utility in a virtual environment in Windows from PyPI.#
[my_xoa_project]> python -m venv .\env
[my_xoa_project]> .env\Scripts\activate

(env) [my_xoa_project]> pip install xoa-utils         # latest version
(env) [my_xoa_project]> pip install xoa-utils==1.0.0  # specific version
(env) [my_xoa_project]> pip install xoa-utils>=1.0.0  # minimum version
Install ANLT Utility in a virtual environment in macOS/Linux from PyPI.#
[my_xoa_project]$ python3 -m venv ./env
[my_xoa_project]$ source ./env/bin/activate

(env) [my_xoa_project]$ pip install xoa-utils         # latest version
(env) [my_xoa_project]$ pip install xoa-utils==1.0.0  # specific version
(env) [my_xoa_project]$ pip install xoa-utile>=1.0.0 # minimum version

Afterwards, your project folder will be:

After creating Python virtual environment#
/my_xoa_project
    |
    |- env

Upgrade From PyPi Repository#

To upgrade ANLT Utility package from PyPI:

Upgrade ANLT Utility in Windows environment from PyPI.#
> pip install xoa-utils --upgrade
Upgrade ANLT Utility in macOS/Linux environment from PyPI.#
$ pip install xoa-utils --upgrade

Note

If you upgrade ANLT Utility using pip install --upgrade xoa-utils, XOA Python API (PyPI package name xoa_driver) will be automatically upgraded.

Install Manually From Source#

If you don’t have internet access, you can install ANLT Utility manually from source, the steps are:

Step 1, make sure Python packages wheel and setuptools are installed on your system. Install wheel and setuptools using pip:

Install wheel and setuptools in Windows environment.#
> pip install wheel setuptools
Install wheel and setuptools in macOS/Linux environment.#
$ pip install wheel setuptools

Step 2, download the ANLT Utility source distribution from ANLT Utility Releases. Unzip the archive and run the setup.py script to install the package:

Install ANLT Utility in Windows environment from source.#
[xoa_core]> python setup.py install
Install ANLT Utility in macOS/Linux environment from source.#
[xoa_core]$ python3 setup.py install

Step 3, if you want to distribute, you can build .whl file for distribution from the source:

Build ANLT Utility wheel in Windows environment for distribution.#
[xoa_core]> python setup.py bdist_wheel
Build ANLT Utility wheel in macOS/Linux environment for distribution.#
[xoa_core]$ python3 setup.py bdist_wheel

Important

If you install ANLT Utility from the source code, you need to install XOA Python API (PyPI package name xoa_driver) separately. This is because XOA Python API is treated as a 3rd-party dependency of ANLT Utility. You can go to XOA Python API repository to learn how to install it.

Start ANLT Utility#

After installing the package and ensuring the SSH key in place, you can start ANLT Utility simply by typing xoa-utils

Start ANLT Utility SSH service.#
> xoa-utils
(PID: 12345) ANLT Utility SSH Service (1.1.0) running on 0.0.0.0:22622.
Start ANLT Utility SSH service.#
$ xoa-utils
(PID: 12345) ANLT Utility SSH Service (1.1.0) running on 0.0.0.0:22622.

Note

If you want to run xoa-utils SSH service on a different port, do xoa-utils <port number>

Uninstall and Remove Unused Dependencies#

pip uninstall xoa-utils can uninstall the package itself but not its dependencies. Leaving the package’s dependencies in your environment can later create conflicting dependencies problem.

We recommend install and use the pip-autoremove utility to remove a package plus unused dependencies.

Uninstall ANLT Utility in Windows environment.#
> pip install pip-autoremove
> pip-autoremove xoa-utils -y
Uninstall ANLT Utility in macOS/Linux environment.#
$ pip install pip-autoremove
$ pip-autoremove xoa-utils -y

See also

See the pip uninstall reference.

See pip-autoremove usage.