Trying to use SciPy in an add-on such that it is automatically installed when users install the add-on.
Why not have in the init method of your addon check for scipy, if not there run a python.exe subprocess to an external script to install it via pip?
We do that for the Rhinoceros 3D importer
import_3dm - bootstrap
ensurepip, then install into a user script path that is in Blender
subprocess to all the Python executable that is bundled with Blender.
Does this assume that the computer has an aactive internet connection? Or are you talking about installing it from some kind of zip bundle?
That is one downside. Another is that complex things like scipy often have other dependencies, dependencies which sometimes need to be compiled.
just a heads up when blender is installed into program files on windows, that code will have run as administrator since regular users do not have write permissions there.
For the ensurepip part I suggest using the
--user argument. And maybe it is even possible to specify a separate location outside of
--user, but still writable for the regular user (think
Then for actually using the bootstrapped
pip to install modules definitely use
bpy.utils.script_path_user() as a location. I believe that one of the
sys.path entries is
/addons/modules. This I use to install the
rhino3dm dependency for my add-on