Deployment Error: Couldn't detect a version for the platform 'python' in the repo.

Sue Folkerts 16 Reputation points
2021-02-22T02:31:40.157+00:00

I am trying to deploy a python flask website. The whole log looks like this: Command: oryx build /home/site/repository -o /home/site/wwwroot --platform python --platform-version 3.6 -i /tmp/8d8d528b8a4e8a5 -p compress_virtualenv=tar-gz -p virtualenv_name=antenv3.6 --log-file /tmp/build-debug.log Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx You can report issues at https://github.com/Microsoft/Oryx/issues Oryx Version: 0.2.20210120.1, Commit: 66c7820d7df527aaffabd2563a49ad57930999c9, ReleaseTagName: 20210120.1 Build Operation ID: |sdUgrJKZUXk=.d70c10b9_ Repository Commit : 04358261fcfbdcd484c8a3839243f2865ad2dc8f Detecting platforms... Could not detect any platform in the source directory. Error: Couldn't detect a version for the platform 'python' in the repo. Error: Couldn't detect a version for the platform 'python' in the repo.\n/opt/Kudu/KuduConsole/Scripts/starter.sh oryx build /home/site/repository -o /home/site/wwwroot --platform python --platform-version 3.6 -i /tmp/8d8d528b8a4e8a5 -p compress_virtualenv=tar-gz -p virtualenv_name=antenv3.6 --log-file /tmp/build-debug.log

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,940 questions
{count} vote

3 answers

Sort by: Most helpful
  1. Grmacjon-MSFT 19,151 Reputation points Moderator
    2021-02-24T21:54:43.777+00:00

    Hi @Sue Folkerts ,

    We apologize for the frustration this issue might have caused. This error "Couldn't detect a version for the platform 'python' in the repo" looks similar to a bug that was reported a few months ago but a workaround was provided here. Posting the workaround here for visibility,

    "As a workaround, create an app setting called DISABLE_HUGO_BUILD with the value true to disable detection for Hugo platform-style apps.

    Long answer: Oryx tries to detect for different platforms used in a repo. In this process, we try to detect for Hugo style apps too. As part of this platform's detection we try to parse files with name config.json for example and from our logs seems like deserialization of this file is failing probably due to invalid content. You can check to see if the json file content is valid and if not fix it or you can disable the Hugo platform detection by creating an app setting called DISABLE_HUGO_BUILD and set it's value to true."

    By the way, how did you install python for your website? Are you following this doc?
    https://learn.microsoft.com/en-us/azure/app-service/configure-language-python

    Please let us know if you have further questions

    Best,
    Grace

    '


  2. Sue Folkerts 16 Reputation points
    2021-02-25T00:53:37.35+00:00

    I managed to solve the issue by installing the Azure App Service extension for Visual Studio.


  3. Rehan Hussain 0 Reputation points
    2023-03-06T11:28:32.8533333+00:00

    I am also having the same issue when trying to deploy from azure Devops a python app. i have added DISABLE_HUGO_BUILD to the app settings and set that as true but same issue occurs.

    Detecting platforms...
    2023-03-06T11:19:37.7279423Z Platform 'hugo' has been disabled, so skipping detection for it.
    2023-03-06T11:19:37.7279815Z Could not detect any platform in the source directory.
    2023-03-06T11:19:37.7280210Z Error: Couldn't detect a version for the platform 'python' in the repo.
    2023-03-06T11:19:37.7280958Z Error: Couldn't detect a version for the platform 'python' in the repo.\n/bin/bash -c "oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform python --platform-version 3.10 -p virtualenv_name=antenv --log-file /tmp/build-debug.log  -i /tmp/8db1e349f9f6fa1 --compress-destination-dir | tee /tmp/oryx-build.log ; exit $PIPESTATUS "
    2023-03-06T11:19:37.7281538Z 
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.