How to call a python package managed by Anaconda in matlab environment?

174 views
Skip to first unread message

Jinfang Wang

unread,
Aug 23, 2017, 1:06:55 AM8/23/17
to NumFOCUS
Hi,

I would like to call a python code in main matlab environment on linux platform.
------------------main matalab program----------------
[status,cmdout] = system('python featurextraction.py')
------error1


------------------------------------------------------

Because Bob package including 'bob.bio.base' is managed by Anaconda, I guess that I should run '[status,cmdout] = system('conda info --envs')' and '[status,cmdout] = system('source activate bob')' in matlab program in advance just like,
------------------main matalab program----------------
[status,cmdout] = system('conda info --envs')
[status,cmdout] = system('source activate bob')
[status,cmdout] = system('python featurextraction.py')
------error2


------------------------------------------------------

Could you tell me how to run 'featurextraction.py' in python language in MATLAB? Because my matlab version is R2012a, I can't call python from MATLAB like the method directly, <https://cn.mathworks.com/help/matlab/examples/call-python-from-matlab.html>, which might need the version after a release of R2015a.

Thank you.

Jinfang
Reply all
Reply to author
Forward
0 new messages