Bot deployment problem. Error occurred while reading WSGI handler: ModuleNotFoundError: No module named 'botbuilder'

Vladislav Tagovich 6 Reputation points

I'm getting error like that:

Traceback (most recent call last):  
      File "D:\home\python364x86\", line 791, in main  
        env, handler = read_wsgi_handler(response.physical_path)  
      File "D:\home\python364x86\", line 633, in read_wsgi_handler  
        handler = get_wsgi_handler(os.getenv("WSGI_HANDLER"))  
      File "D:\home\python364x86\", line 605, in get_wsgi_handler  
        handler = handler()  
      File ".\", line 102, in get_virtualenv_handler  
        handler = get_wsgi_handler(os.getenv('WSGI_ALT_VIRTUALENV_HANDLER'))  
      File ".\", line 89, in get_wsgi_handler  
        raise ValueError('"%s" could not be imported%s' % (handler_name, last_tb))  
    ValueError: "app.wsgi_app()" could not be imported: Traceback (most recent call last):  
      File ".\", line 73, in get_wsgi_handler  
        handler = __import__(module_name, fromlist=[name_list[0][0]])  
      File ".\", line 11, in <module>  
        import botbuilder  
    ModuleNotFoundError: No module named 'botbuilder'  

I don't know why it happends because i have a YAML deploy file that have pip install:

name: Build and deploy Python app to Azure Web App - azurebot-test-1  
      - master  
    runs-on: ubuntu-latest  
    - uses: actions/checkout@master  
    - name: Set up Python version  
      uses: actions/setup-python@v2  
        python-version: '3.6'  
        addToPath: true,  
        architecture: 'x64'  
    - name: Install Python dependencies  
      run: |  
        python -m venv env  
        cd env/Scripts/  
        chmod -R 777 ./activate  
        cd ../../  
        pip install --user -r requirements.txt  
    - name: Zip the application files  
      run: |  
        sudo apt-get install zip gzip tar  
        zip -r .  
    - name: 'Deploy to Azure Web App'  
      uses: azure/webapps-deploy@v1  
        app-name: 'azurebot-test-1'  
        slot-name: 'production'  
        publish-profile: ${{ secrets.AzureAppService_PublishProfile_8630fb021e6f4db6a8107f4c9aaca965 }}  
        package: './'  

And my web.config is:

<?xml version="1.0"?>  
<!-- Generated web.config for Microsoft Azure. Remove this comment to prevent  
     modifications being overwritten when publishing the project.  
        <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">  
          <filter type="" />  
    <add key="WSGI_ALT_VIRTUALENV_HANDLER" value="app.wsgi_app()" />  
    <add key="WSGI_ALT_VIRTUALENV_ACTIVATE_THIS" value="D:\home\site\wwwroot\env\Scripts\" />  
    <add key="WSGI_HANDLER" value="ptvs_virtualenv_proxy.get_virtualenv_handler()" />  
    <add key="PYTHONPATH" value="D:\home\site\wwwroot" />  
    <compilation debug="true" targetFramework="4.0" />  
    <httpErrors errorMode="Detailed" existingResponse="PassThrough"></httpErrors>  
    <modules runAllManagedModulesForAllRequests="true" />  
      <add name="Python FastCGI" path="handler.fcgi" verb="*" modules="FastCgiModule" scriptProcessor="D:\home\python364x86\python.exe|D:\home\python364x86\" resourceType="Unspecified" requireAccess="Script" />  
        <rule name="Static Files" stopProcessing="true">  
            <add input="true" pattern="false" />  
        <rule name="Configure Python" stopProcessing="true">  
          <match url="(.*)" ignoreCase="false" />  
            <add input="{REQUEST_URI}" pattern="^/static/.*" ignoreCase="true" negate="true" />  
          <action type="Rewrite" url="handler.fcgi/{R:1}" appendQueryString="true" />  

I had another problem like that with other package "aiohttp", that was identical, so i added an extension with azure panel a Python 3.6x86 and changed the python path in scriptProcessor. It is solved the problem after many of cmd manipulations in new python path with manual pip installs with some flags that i can't remember, but after that problem steped to the next line of imports.
I can share my app.wsgi_app(), ptvs_virtualenv_proxy.get_virtualenv_handler() functions that used in my web.config or just say what i can share with you

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
785 questions
{count} votes