Installing pip packages in blender... via import!

Saw this and thought this might be interesting for addon’s needing packages from pip:

On Mac OS High Sierra you can install PIP3 by finding the python binary in the Blender application install. Then just run the ‘get-pip.py’ script using that executable.

ie:

/Applications/Blender/blender.app/Contents/Resources/2.79/python/bin/python3.5m get-pip.py

This works just fine. PIP3 executable script its then installed in the same path as the python binary.

/Applications/Blender/blender.app/Contents/Resources/2.79/python/bin/pip3 install numpy

So far I have installed numpy, matplotlib, pandas, psycopg2, and several other libraries into Blender python. As a test I generated a Matplotlib plot from Blender to a PNG file and then loaded it as a texture into a material for rendering on an object. Works great!

Just as a note: Matplotlib will not open figure (GUI) from Blender. It will render figures to files though.
Psycopg2 allows connection to PostgresSQL relational database.

Have fun.