Hello!
I have a python web app on Azure.
How can I install torch with requirements.txt?
With the Web SSH, it always restarts.
Hello!
I have a python web app on Azure.
How can I install torch with requirements.txt?
With the Web SSH, it always restarts.
Hi @SuperMX-6605,
When you deploy your Python app, Azure App Service will create a virtual environment to and run pip install -r requirements.txt. If you don't see this happening, make sure SCM_DO_BUILD_DURING_DEPLOYMENT is set to 1. See https://docs.microsoft.com/en-us/azure/app-service/configure-language-python for more details. If you're seeing errors during app startup, please comment down below.
Hello @ryanchill , thank you for your answer!
SCM_DO_BUILD_DURING_DEPLOYMENT was already set to 1.
I've tried a lot and it seems the build only fails if i add torch to requirements.txt. But without, of course it cannot find the module.
This is the end of the deployment log:
*[21:11:00+0000] Collecting numpy
[21:11:00+0000] Downloading numpy-1.21.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl (15.8 MB)
[21:11:02+0000] Collecting torch
[21:11:02+0000] Downloading torch-1.9.0-cp38-cp38-manylinux1_x86_64.whl (831.4 MB)
An unknown error has occurred. Check the diagnostic log for details.
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Package deployment using ZIP Deploy failed. Refer logs for more details.*
It is linux based but I was able to install it with putting the pytorch path in the requirements.txt! (Install from path).
Do you still want the logs?
Try adding this to the requirements file. It worked for me.
-f https://download.pytorch.org/whl/torch_stable.htmltorch==1.11.0+cputorchvision==0.12.0+cpu
14 people are following this question.