Python is recognised in MATLAB but basic functions are not working
Afficher commentaires plus anciens
I'm Having a wierd problem with my using my python installation in MATLAB. I'm using version 2022b and this one is compatible with python 3.10. So I installed that version and it works fine with pycharm or when I run the .exe file and just use python. Then back in MATLAB i tried using both penv and pyverion using the file location for the python executable. This gave me somthing like this
pyversion
version: '3.10'
executable: 'C:\Users\omermb\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe'
library: 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\python310.dll'
home: 'C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0'
isloaded: 0
pyenv
ans =
PythonEnvironment with properties:
Version: "3.10"
Executable: "C:\Users\omermb\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
Library: "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\python310.dll"
Home: "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0"
Status: NotLoaded
ExecutionMode: OutOfProcess
It's in the WindowApps folder since I downloaded it thought the store.
However all funciton I try to rung give me the error message
py.abs(2)
Unable to resolve the name 'py.abs'.
Even the ones that should be built in python functions don't work.
So it's finding the correct executable but it does not seem to be working for some reason.
This has worked before, but I wanted to update to R2022 and python 3.10, and python 3.9 also was not working.
Any ideas?
Réponses (1)
Omer Babiker
le 15 Déc 2022
Catégories
En savoir plus sur Call Python from MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!