14/09/2015

Adding matplotlib to locally installed blender

Update: Unless you hate virtual environments, I found a better way:
https://eumenidae.blogspot.com/2020/01/installing-external-python-modules-for.html
I had some trouble getting a local blender 2.75 in my home directory to use matplotlib - using the system wide python3.4 for some reason failed, so in the end I just copied over files to the local version until blender stopped complaining.
Required packages for Ubuntu 14.04: python3-pyparsing, python3-dateutil¸ python3-matplotlib, python3-cycler, python3-six. Using the following destination root directory ~/bin/blender/2.75/python/lib, I copied these files and folders:
sourcedestination
/usr/lib/python3/dist-packages/pyparsing.pypython3.4/site-packages/
/usr/lib/python3/dist-packages/dateutilpython3.4/site-packages/
/usr/lib/python3/dist-packages/matplotlibpython3.4/site-packages/
/usr/lib/python3/dist-packages/mpl_toolkitspython3.4/site-packages/
/usr/lib/python3/dist-packages/pylab.pypython3.4/site-packages/
/usr/lib/python3/dist-packages/cycler.pypython3.4/site-packages/
/usr/lib/python3/dist-packages/six.pypython3.4/site-packages/
/usr/lib/python3.4/distutilspython3.4/
A bit ridiculous for just wanting to use their colour maps, but there you go… Note: Still works for blender 2.77/Python 3.5/Kubuntu 16.04. Replace Python3.4 with Python3.5.