The processing plugin may not be at '/home/user/.qgis2/python/plugins'. You can find the location by opening QGIS and clicking plugins/Manage and install plugins scroll down to processing and you will see the installation location in the description.
– Mr PurpleMar 25 '16 at 23:48

You can make the standalone script even more generic by dropping layerInput and changing the runalg line to: general.runalg(*sys.argv[1:]) not to mention that this script can be the basis for parallel GIS processing as per this question: gis.stackexchange.com/questions/119961/…
– Mr PurpleApr 8 '16 at 22:28

Is it possible to do the same framework but to run PLUGINS from a standalone Python (not inside QGIS)? I executed alglist() function and I cannot see my plugins installed in my QGIS in there...
– IreneJun 14 '17 at 15:27

Until I get to work the generic way of doing it, I will tell you a workaround.

I use the Processing plugin version 2.2.0-2 (I suggest you to use this version), which is installed in /home/germap/.qgis2/python/plugins/ on my computer. You need to know this folder location, because you import the processing module from there.

Since you know the provider (qgis) and the algorithm (explodelines), you can look at /home/germap/.qgis2/python/plugins/processing/algs/qgis/ to take the explode lines script name: Explode.py This information allows you to import the algorithm directly to your Python standalone script.

So, open a Python console and copy the following script (I use GNU/Linux, so the environment variables are set by default, allowing me to import qgis and PyQt4 libraries in a breeze):