- Open File Explorer and navigate to the Python installation directory, for example, C:\Users\username\AppData\Local\Programs\Python\Python39.
- Right-click on the Python folder and select "Properties."
- Go to the "Security" tab.
- Click "Edit," then "Add."
- Click "Advanced," and under "From this location," select your computer's hostname (you can find your hostname by typing hostname in the Command Prompt).
- Click "Find Now," locate, and select "MwWebAppWorkerR2024a" (or the appropriate account for your MATLAB version).
- Grant the necessary permissions to the Web App Server account to allow it to run your web application.
How to use Python on Webapp Server running on Windows?
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have created predict.py and added to .ctf, In startup I have used following code
if isdeployed
pyenv(Version="C:\Users\MatlabWebAppVM\AppData\Local\Programs\Python\Python39");
[filepath,~,~] = fileparts(mfilename('fullpath'));
insert(py.sys.path, int64(0), filepath);
end
Getting this error while running on server
0 Commenti
Risposte (1)
Rushikesh
il 8 Ott 2024
Modificato: Rushikesh
il 8 Ott 2024
Hello,
I understand that you're trying to execute Python code within a MATLAB Web App by setting the 'pyenv' version in the 'startupFcn'. However, you're encountering a long loop that ends with a "Something went wrong" error. This error typically occurs when the MATLAB Web App Server is unable to access the Python installation directory.
The MATLAB Web App Worker account, named “MwWebAppWorkerR2024a” (replace with the appropriate version for your MATLAB installation), needs permission to access your Python executable directory.
Here's how you can set the necessary permissions on Windows:
I've attached a screenshot of the “Properties > Security > Edit > Add” window for clarity. For more detailed instructions on configuring the MATLAB Web App Server to use Python, you can refer to the below MATLAB Answer.
Hope this helps you.
0 Commenti
Vedere anche
Categorie
Scopri di più su Python Client Programming in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!