Malab Python problem -- isloaded set to 0
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Mahesh
il 21 Ott 2014
Modificato: Robert Snoeberger
il 24 Ott 2014
Hi,
I have downloaded the newest Matlab (R2014b) and am trying to call a Python script from my Matlab script. When I run "pyversion" I get this output:
version: '2.7'
executable: '/Applications/anaconda/bin/python2.7'
library: '/Applications/anaconda/lib/libpython2.7.dylib'
home: '/Applications/anaconda'
isloaded: 0
Why is "isloaded" equal to 0, why isn't it loading? I'm not sure how to fix this issue.
0 Commenti
Risposta accettata
Robert Snoeberger
il 22 Ott 2014
Modificato: Robert Snoeberger
il 24 Ott 2014
The output from "pyversion" looks reasonable. You don't need to explicitly load Python. It will load when it is needed, which is the first time you access the "py" package. Have you tried the example in the documentation?
When MATLAB is started pyversion returns 0 (false) for isloaded. You may still change the version of Python while isloaded is 0 (false). See pyversion documentation. Python loads dynamically upon the first usage of the “py” package. If isloaded is 0 (false) but you believe it should be 1 (true), then see the trouble shooting documentation.
2 Commenti
Robert Snoeberger
il 22 Ott 2014
If you are in the directory where the Python script lives, then you probably need to add the current folder to the Python path. See the example in the documentation:
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Call Python from MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!