Install Python plugin in SNAP

I am trying to develop a python plugin in SNAP. I have started with the example given in github at:

How to install it in my SNAP desktop.

1 Like

I got some hints from the existing plugin here:

So, there are some prerequisites,

  1. Oracle JDK version 8 or later
  2. Build tool Maven must be installed (version 3 or later)
    ** First install java jdk and set PATH environment: https://javatutorial.net/set-java-home-windows-10
    **Then follow configuring Maven: http://maven.apache.org/install.html

Now, Download or clone git repository files.
From windows cmd go to that directory, and build the plugin nbm with cmd using:

> mvn package

Then How to install and run the processor as SNAP plugin see:

Hi,
I hope that will helpful

The python plugin
The python plugin can be used by either Python 2 or Python 3 based parts using one of the following:

a requirements.txt file used to import Python modules
a setup.py script for building the project
packages installed directly from pip
This plugin uses the common plugin keywords as well as those for “sources”. For more information, see Snapcraft parts metadata.

Plugin-specific features and syntax are dependent on which base is being used, as outlined below:

base: core20
base: core18 | core
See Python applications for a simple example, or search GitHub for projects already using the plugin.

base: core20
This plugin uses the following plugin-specific keywords:

requirements (array)
List of paths to requirements.txt file(s)
constraints (string)
Path to a constraints file.
python-packages (list)
A list of dependencies to install using pip. This supports the same syntax as the pip install command.
This plugin also interprets these specific build-environment entries:

SNAPCRAFT_PYTHON_INTERPRETER
(default: python3)
The interpreter binary to search for in PATH.

SNAPCRAFT_PYTHON_VENV_ARGS
Additional arguments for venv.

By default, this plugin uses Python from the base snap. If a part using this plugin uses a build-base other than that of the base, or a different interpreter is desired, it must be bundled in the snap (including venv) and must be in PATH.

It is required to bundle python when creating a snap that uses classic confinement, this can be accomplished on Ubuntu by adding stage-packages (i.e.; python3-venv).

Use of python3- in stage-packages will force the inclusion of the python interpreter.

Requires Snapcraft version 4.0+.

base: core18 | core
This plugin uses the following plugin-specific keywords:

requirements (array)
List of paths to requirements.txt file(s)

constraints (string)
Path to a constraints file

process-dependency-links (bool; default: false)
Enable the processing of dependency links in pip, which allow one
project to provide places to look for another project

python-packages (list)
A list of dependencies to install using pip. This supports the same syntax as the pip install command. For example:

python-packages:

python-version (string; default: python3)
The python version to use. Valid options are python2 and python3

The python plugin also searches /usr/bin/ for a Python interpreter with a basename matching python-version in the directory. If detected, this takes preference and stage-packages will not use its own interpreter.

If want to learn deep about advance python and its plugin then visit : https://www.cetpainfotech.com/technology/python-training