Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

In order to use external modules on Saagie platform it is possible to use pip requirements.txt file.

For example to use statistic module:

Requirements.txt

  • The following file will be used as an entry point script:
File _main_.py
# Module import
import statistics


# Use of module
def compute_mean(data):
    statistics.mean(data)


# Script
if __name__ == '__main__':
    compute_mean([1, 5, 9, 6, 7])

  • A requirements.txt file has also to be created:
File requirements.txt
statistics
  • Then you'll have to package both file into a zip archive with the following structure:

Please note that whenever there is more than one python file into the zip archive, there have to be a __main__.py file which will be used as an entry point.

  • You can then create a job and use the following command to launch the script:
Python execution command
python {file}

pip install

It is also possible to install modules manually using pip.

You'll need to upload the previously created __main__.py file on your job creation and list the list of package you want to install.

Manual pip installation
pip install statistics
python {file}


  • No labels