Blender: installing pip module from within python
Since some time the pip module is already installed in blender's python-distro. As I'm using pyzmq in my Urho3D-Blender exporter to have live-preview this is good news.
Till now I urged the people using the exporter to strictly follow the rules for setting it up. And its actually not only that, you also need to install 2 addons the exporter is depending on. π
And we all know that reading closely is a though thing to do (and I don't exclude me here). I tried to smooth the process,...well π
Now I found the solution:
import bpy
import subprocess
pybin = bpy.app.binary_path_python
subprocess.check_call([pybin, '-m', 'pip', 'install', 'your_package'])
....I only need to integrate it in the exporter. And I guess I should pack the dependend libraries (I created those myself) also,....