Issues with matlab runtime on windows, python references wrong matlab

12 visualizzazioni (ultimi 30 giorni)
Hello,
I'm having some issues with my matlab runtime. The problem occurs when I'm to import my compiled matlab functions in python. I basically have two matlab installations in addition to matlab runtime, it is matlab 2019b and matlab 2018b. The matlab runtime is also 2019b.
However, when I'm to import the function that I have compiled it says:
RuntimeError: Could not find the directory C:\Program Files\MATLAB\R2019b\toolbox\compiler_sdk\pysdk_py
The error makes sense since it is trying to access the wrong matlab installation.
I have tried to add the matlab runtime to my system path on windows but it is not working. Also, I compiled the function on a linux machine, I do not know if that matters.
Any suggestions?

Risposte (1)

Antti
Antti il 20 Feb 2024
I think this might be because in the system path environment variable, your MATLAB installation path appears before the MATLAB runtime path. Move the runtime path up, so that it appears first before any MATLAB installations.
Sometimes you might also encounter a similar error, but the missing directory is actually under the MATLAB Runtime installation directory, i.e. you see something like this:
RuntimeError: Could not find the directory C:\Program Files\MATLAB Runtime\R2019b\toolbox\compiler_sdk\pysdk_py
This is most likely because you have previously installed MATLAB Runtime for running other type of applications, such as standalone executables etc. These are generated with MATLAB Compiler, whereas software libraries, such as Python libraries, are generated with Compiler SDK. Hence, you're missing the Compiler SDK part of the MATLAB Runtime. The solution is to install the full version of MATLAB Runtime, which youc an download from this website, or use the installer file that was most likely generated when the Python library was packaged.

Categorie

Scopri di più su C Shared Library Integration in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by