Running Python script in MATLAB - Get following error: ModuleNotFoundError: No module named 'odrive'
22 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am trying to run a .py script in MATLAB. The script runs fine in Python (Using Spyder). However, when I try to run it from MATLAB is says the modules being imported are not found - Do I need to include the modules in the MATLAB path for the python script to run? If so, how would I go about doing that?
Thanks in advance!
This is the error being thrown:
>> odrive_matpy_test
Traceback (most recent call last):
File "D:\Users\Documents\odrive_test.py", line 10, in <module>
import odrive
ModuleNotFoundError: No module named 'odrive'
I have tried this - is this the right idea?
PATH_PYTHON = 'C:\Users\Anaconda3\lib\site-packages\odrive';
setenv('PYTHONPATH', PATH_PYTHON);
system('odrive_test.py');
0 Kommentare
Antworten (1)
Santhosh A V
am 13 Mär. 2019
Including full path of python.exe in the system command along with the .py file might help in resolving the error.
Please refer below link for more information.
Thanks
Santhosh
0 Kommentare
Siehe auch
Kategorien
Mehr zu Call Python from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!