I looked around on Google, and found that python has support for this through the scipy module. According to this StackExchange page, all you need to do is:
import scipy.io
mat = scipy.io.loadmat('file.mat')
When I try this in the python interface in blender though, I get the following error:
ModuleNotFoundError: No module named 'scipy'
Is there a way to get this module to work, or any other way to import a .mat file into bpy?
Thanks for the help!
From that I got the following error:
– Rublie14 Jun 04 '21 at 08:40ERROR: Could not install packages due to an OSError: [WinError 5] Access is denied: 'C:\\Program Files\\Blender Foundation\\Blender 2.92\\2.92\\python\\Lib\\site-packages\\scipy' Consider using the '--user' option or check the permissions.I don't know what to do with this though, as I have no idea how to add '--user' to this...["install", "scipy", "--user"]which would emulate the required pip cli command. (or navigate to folder and run pip from cli as admin) There are a number of posts on installing 3rd party modules. My 2c worth is look at making a virtual env running same python version as blender, and point blenders python to it. – batFINGER Jun 06 '21 at 15:25pip.main["install", "scipy", "--user"]yet, but unfortunately when I do, I get the following error:TypeError: 'function' object is not subscriptable... I barely understand what I am doing, as I am very inexperienced with this stuff, so I don't really understand what you say in the rest of your post. If you have any idea what went wrong when I ran that command I would love to hear it! Thanks. – Rublie14 Jun 07 '21 at 14:13pip.main([...])Suggest googling python error messages if unsure of their meaning. – batFINGER Jun 07 '21 at 15:12Successfully installed scipy-1.6.3. The only problem now is that if I try theimport scipycommand, it still gives me the errorModuleNotFoundError: No module named 'scipy'... How is that even possible if it was literally installed through the blender python console? I already googled this many times, but then I get back to where I started, so your help is the only lead I have right now haha – Rublie14 Jun 07 '21 at 15:41sites.py) Installing using --user installs on linux to$HOME/.local/lib/python3.7/site-packagesadd corresponding path for windows (look it up in pip docs) tosys.path– batFINGER Jun 07 '21 at 15:46