Import data from matlab

If you have problems understanding something or getting started, ask here

Moderator: joepal

Import data from matlab

Postby newby » Fri Dec 16, 2022 4:06 pm

I'm writing because I didn't find a question related to import data from Matlab.

I need to import data saved in a .mat file from Matlab.

In Blender i could do the same thing with:

Code: Select all
import scipy.io
from scipy.io import loadmat
mat = loadmat(' filepath')


Here I have trouble that MH recognizes the scipy package. Errormessage --> ModuleNotFoundError: No module named 'scipy'

So my question would be, where have the folders from https://github.com/scipy/scipy/tree/main/scipy have to be that MH recognizes it and is able to import it?
newby
 
Posts: 2
Joined: Fri Dec 16, 2022 4:02 pm

Re: Import data from matlab

Postby Aranuvir » Fri Dec 16, 2022 7:22 pm

Interesting. I didn't know, scipy is a dependency of Blender and not so surprisingly the import statement gave the same ModuleNotFoundError...

However, back to MakeHuman.
I don't know why, but I get the impression you are working on Windows, otherwise your solution should be straight forward. On Windows the MakeHuman package is distributed with its own Python interpreter, that's why it can't find other dependencies. Your best solution would be running MakeHuman from source. The amount of dependencies is minimal (PyQt5, numpy and pyopengl). And if you want some Ipython support in MakeHuman's shell, get jupyterlab/qtconsole.

Good luck!
Aranuvir
 
Posts: 1314
Joined: Sun Oct 12, 2014 2:12 pm

Re: Import data from matlab

Postby joepal » Sat Dec 17, 2022 10:47 am

EDIT: Sorry, I misunderstood the question

Theoretically you can use PIP to update the bundled python dependencies, even with the minimal python that MH ships with. I have not tested this, but if you find the python executable in a cmd window, you should be able to do:

Code: Select all
python.exe -m ensurepip
python.exe -m pip install --upgrade pip
python.exe -m pip install --upgrade scipy


For this to work you need to have write access to where you installed MH.

However, as Aranuvir says, you're probably better off running makehuman from source. Download a proper python installation, use PIP to install scipy and the dependencies needed by MH and then run the makehuman.py script directly. There are more detailed instructions at https://github.com/makehumancommunity/m ... /README.md
Joel Palmius (LinkedIn)
MakeHuman Infrastructure Manager
http://www.palmius.com/joel
joepal
 
Posts: 4465
Joined: Wed Jun 04, 2008 11:20 am

Re: Import data from matlab

Postby newby » Tue Dec 20, 2022 9:55 am

Thanks for your help.

In the end I converted my mat files to json files, this way it was possible to avoid scipy.
newby
 
Posts: 2
Joined: Fri Dec 16, 2022 4:02 pm


Return to Newbies

Who is online

Users browsing this forum: Google [Bot] and 1 guest

cron