Python Error: ModuleNotFoundError during execution in a Web App
显示 更早的评论
Hi everyone,
I created a simple App in AppDesigner on Linux where I call a python function output = py.MyModule.myFunction()
In this py script I also import the opcua library. This works without problems.
Next, I complied it to a matlab web app (ctf file) and ran it on the same machine within the Matlab Web App Server.
I also added the MyModule.py File in Files required for your app to run in the Web App Compiler.
Moreover, I added the current folder to the python system path during the startup function and tried to load the opcua lib.
if isdeployed
[filepath,~,~] = fileparts(mfilename('fullpath'));
insert(py.sys.path, int64(0), filepath);
...
py.importlib.import_module('opcua');
end
But at the start comes directly an error:

I have extra output the properties of the Python environment and compared it with the one in Matlab. It shows the same properties:

Now, unfortunately, I do not know what to do. Does anyone have an idea what the problem is?
Thanks in advance!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Python Client Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!