problem in calling out python script from matlab when i am calling the script from matlab its showing error in adafruit library ,it is in same directory . working in python

回答(1 个)

Try to add that folder into your PYTHONPATH env var.

10 个评论

We have already done that. MATLAB is already reading this python library but the problem is there is some problem in running this python file. Inittialy we have run this python file directly in Raspberry OS to control the servos. and it worked fine, now I want to run servos using this python library from MATLAB using DEPLOY function. but it is showiung this error.
Then we have tried to run this python file ditrectly still it showed the same error in python.
Thanks for answering.
Best Regards.
You are running this on Windows, right?
But error message is about a missing directory on Linux/RaspberryOS (/proc/cpuinfo doesn't look like a Windows path)? Seems like a configuration problem somewhere.
yes we are running on windows. we have to write full program in MATLAB with use of python libraries. and then deploy the code from MATLAB to raspberry.
Please suggest some solutions to make that library working on windows.
Thanks for answering.
What python libraries are you using please? My feeling here is that one of the python lib is not configured properly for Windows. It uses a Linux/raspberry path (/proc/cpuinfo).
i have tried installing these libraries on my windows by pip command ,so when i install them in my windows its showing package succesfully install but again the problem is same.
Can you run the python script outside Windows (directly from python)? Does it work?
Also try to call a HelloWorld python script from matlab. See if that works.
no its not working outside also .i have tried calling hello world script via matlab its working.
If it is not working outside matlab, then it is a python issue, right? Not a matlab issue.
yes ,but we have to use pythin libraries as its alreadz there to run servo motors of our adeept robot.
this link shows how python codes helps to run servo motor through raspberry. But we want to run it through MATLAB then deploy in raspberry for our project.
Strictly speaking, this is a matlab forum. If you can figure out which python lib/package causes your problem, maybe you can get help/support from the developer of that lib. Once it can run successfully outside matlab, then we can figure out how to run it from matlab.

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Call Python from MATLAB 的更多信息

产品

版本

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by