To add third-party modules as dependencies to a plugin package, create and reference a folder or ZIP file with the sites of the dependencies in an XML file located next to the folder for the plugin package. The XML file must have the same name as the plugin package plus an .xml extension.

When the ansys.dpf.core.core.load_library() method is called, PyDPF-Core uses the site Python module to add custom sites to the path for the Python interpreter.

To create these custom sites:

  1. Install the requirements of the plugin package in a Python virtual environment.

  2. Remove unnecessary folders from the site packages and compress them into a ZIP file.

  3. Place the ZIP file in the plugin package.

  4. Reference the path to the ZIP file in the XML file as indicated above.

To simplify this step, you can add a requirements file in the plugin package:

wheel
pygltflib

For this approach, do the following:

  1. Download the script for your operating system:

  1. Run the downloaded script with the mandatory arguments:

    • -pluginpath: Path to the folder with the plugin package.

    • -zippath: Path and name for the ZIP file.

    Optional arguments are:

    • -pythonexe: Path to a Python executable of your choice.

    • -tempfolder: Path to a temporary folder to work in. The default is the environment variable TEMP on Windows and /tmp/ on Linux.

  2. Run the command for your operating system.

  • From Windows PowerShell, run:

    create_sites_for_python_operators.ps1 -pluginpath /path/to/plugin -zippath /path/to/plugin/assets/winx64.zip
    
  • From Linux Shell, run:

    create_sites_for_python_operators.sh -pluginpath /path/to/plugin -zippath /path/to/plugin/assets/linx64.zip