Installation#

This guide explains how to install the lenz-flashtool library and its dependencies.

Prerequisites#

  • Python 3.8 or higher

  • pip (Python package manager)

  • XR21V1410 system driver for Windows (not required for Linux)

  • LENZ FlashTool device

  • A BiSS C compatible encoder device (e.g., LENZ Encoders)

Installation Steps#

  1. Install lenz-flashtool:

    It is strongly recommended to use a virtual environment when installing Python libraries to avoid conflicts with other packages. The installation will remain isolated within the virtual environment.

    # Create a virtual environment
    python -m venv myenv
    
    # Activate it (Windows)
    myenv\Scripts\activate
    
    # Install library
    pip install lenz-flashtool
    
    # Create a virtual environment
    python -m venv myenv
    
    # Activate it (Linux/Mac)
    source myenv/bin/activate
    
    # Install library
    pip install lenz-flashtool
    

    To deactivate the virtual environment when done:

    deactivate
    

    Note

    The package is installed as lenz-flashtool (with a hyphen), but imported in Python as lenz_flashtool (with an underscore) due to Python’s naming conventions.

  2. Install XR21V1410 USB-UART driver for Windows:

    Linux users can skip this step.

    Download and install the driver from: https://www.maxlinear.com/product/interface/uarts/usb-uarts/xr21v1410

  3. Verify the library installation:

    Check that the library is installed:

    import lenz_flashtool
    print(lenz_flashtool.__version__)
    

    This should display the version (e.g., 0.1.0).

  1. Try CLI (Optional):

    A command-line interface is included with the library. You can test it:

    python -m lenz_flashtool.biss.cli registers
    

    If installed using pip, you can also run:

    lenz-flashtool-cli readserial
    

Troubleshooting#

  • ModuleNotFoundError: Ensure pip installs to the correct Python environment. Use pip --version to check.

  • FlashToolError: LENZ FlashTool not found!: Ensure your FlashTool device is connected and the driver is installed (on Windows).

See Getting Started for an introduction or Usage for usage examples.