Configuring Python for use with Analytics

Note

These configuration instructions refer to a customer-installed instance of Python required to use Analytics Python functions. This instance of Python is not the same as the instance of Python that can be installed as part of the Analytics installation to support machine learning commands.

To configure Python to work with Analytics, you must install a compatible version of Python and add the Python executable to your computer's PATH environment variable. You must also set the ACLPYTHONDLL and PYTHONPATH system environment variables.

How it works

To run Python scripts, Analytics must be able to call the Python executable and find the scripts it is instructed to run. Analytics uses the PATH environment variable to locate Python and the PYTHONPATH environment variable to locate scripts.

Install Python (32-bit)

  1. Laden Sie von der Python-Downloadseite eine der folgenden Versionen von Python auf Ihren Computer oder den Server herunter.
    • 3.7.x
    • 3.8.x
    • 3.9.x

    Hinweis

    Die angegebenen Python-Versionen wurden getestet. Dabei wurde bestätigt, dass sie mit Analytics und/oder Robots-Agent kompatibel sind.

    Alle Versionen von Python ab 3.7.x sollten kompatibel sein. Allerdings kann nicht garantiert werden, dass andere als die aufgeführten Versionen funktionieren.

  2. Doppelklicken Sie auf Ihrem Computer oder Server auf das Installationsprogramm.
  3. Im Installationsprogramm wählen Sie Add Python Versionsnummer to PATH.
  4. Klicken Sie auf Installieren und folgen Sie den Anweisungen auf dem Bildschirm.
  5. Starten Sie den Computer oder den Server neu, bevor Sie Python-Skripts ausführen, die durch ein Analytics-Skript aufgerufen wurden.

Set the ACLPYTHONDLL and PYTHONPATH environment variables

  1. Legen Sie im Betriebssystemlaufwerk C:\ einen oder mehrere Ordner für Ihre Python-Skripte an.

    Beispiel C:\Python-Skripts.

  2. Öffnen Sie innerhalb Ihres Betriebssystems das Dialogfeld Systemeigenschaften, und klicken Sie auf Umgebungsvariablen.
  3. Klicken Sie im Abschnitt Systemvariablen auf Neu und geben Sie folgende Variablen ein:
    VariablennameVariablenwert
    PYTHONPATH

    Der vollständige Pfad der Ordner, die Sie für Ihre Python-Skripts erstellt haben. Trennen Sie mehrere Ordnerpfade durch ein Semikolon.

    Beispiel:

    C:\python_scripts;C:\dev;C:\tmp
    ACLPYTHONDLL

    Der vollständige Pfad und Dateiname der Python-DLL-Datei im Python-Installationsordner.

    Beispiel:

    c:\python_install\python35.dll

    Hinweis

    Bei der Installation legt Python die DLL im Systemordner (c:\windows\system32\python35.dll) ab und nicht im Installationsordner. Sie müssen die DLL aus dem Systemordner in den Installationsordner kopieren und den Speicherort des Installationsordners als Variablenwert verwenden. Analytics oder der Robots-Agent sucht die DLL im Python-Installationsordner.

    Möglicherweise müssen Sie den Schreibschutz für den Installationsordner aufheben.

  4. Um die Variable zu speichern, klicken Sie auf OK und im Dialogfeld Systemeigenschaften erneut auf OK.

Use Python in Analytics Python functions

From Analytics, use the Analytics Python functions to call functions in scripts that exist in your PYTHONPATH.

For more information, see Python.

Note

If you make any edits to a Python script, you must refresh the view in your Analytics project to use the latest version of the Python script. The simplest way to refresh the view is to close the table you are working with and then re-open it.