I’d probably suggest packaging the pip’d module with your plugin instead and just have your script add it to PATH on startup? (or if this is for an internal company thing, just make sure you add it on Painter startup. Should work fine (as that’s what we do as well).
You can still run pip from within your code in order to install numpy if you don’t want to bundle it with your Substance plugin. You just need to call it as an external process.
(make sure sys.executable is the python.exe and not substance.exe)
I found packaging the pip module with the plugin wont work with p4pthon pip. This is due to the .pyd that comes with P4.py file needing to be in appData\Roaming. So subprocess would be the way forward. Using that approach has worked. Thanks @ross-g
Below shows code to check p4pthyon is present in Painter before my bespoke menu is built. If it’s not present to user, then it will be intsalled with pip.