Why can't I run my python script from Matlab?
13 views (last 30 days)
I am trying to use this line
Where intervals is a python script. I get the error
Undefined variable "py" or class "py.intervals.py".
I am using R2018b. Do I need to purchase a Python Libraries API?
Prathamesh Degwekar on 21 May 2019
I see two possible corrections you could try. Firstly try calling the python module itself instead of the file name (like "py.mymod.search(N)" instead of "py.mymod.py").
Secondly, maybe your file isn't in the python search path. If it isn't, try adding your folder to the python sys path using:
if count(py.sys.path,'') == 0
Rafael Rebouças on 19 Jan 2021
Edited: Rafael Rebouças on 19 Jan 2021
% Simple way to load your library
copyfile(my_library_file_path, pwd, 'f');
% It's necessary to load library
Now, your Python library is loaded to use in any directory.