Hi, for info, got an end-member extraction with pysptools
First you need to get a single ENVI formatted file having all spectral bands in it.
r.out.gdal --o input=M3_mid output=A12_mid format=ENVI type=Float32
Then run the following script in Python adapted from the pysptools tutorials
(deps: python-sklearn, python-cvxopt)