Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从MATLAB调用Python文件_Python_Matlab_Call_Permission Denied_Bin - Fatal编程技术网

从MATLAB调用Python文件

从MATLAB调用Python文件,python,matlab,call,permission-denied,bin,Python,Matlab,Call,Permission Denied,Bin,我试图从MATLAB调用Python函数,但遇到了一个权限被拒绝的错误 function [success] = run python() %system('sudo easy_install requests'); %system('sudo easy_install PyCrypto'); system('/Users/mmk/Desktop/Folder/run.py') success = 1; end 错误是: /bin/bash: /Users/mmk/Desktop/Fold

我试图从MATLAB调用Python函数,但遇到了一个权限被拒绝的错误

function [success] = run python()
%system('sudo easy_install requests');
%system('sudo easy_install PyCrypto');
system('/Users/mmk/Desktop/Folder/run.py')

success = 1;

end
错误是:

/bin/bash: /Users/mmk/Desktop/Folder/run.py: Permission denied

ans =

    1 
我不确定在这种情况下我应该做什么。有什么想法吗

找到了答案


它需要是系统(“python/Users/mmk/Desktop/Folder/run.py”)

或者,如果您的python文件是可执行的(google chmod),并且您创建了文件的第一行
#/usr/bin/env-python
您以前的方法也应该有效。