繁体   English   中英

Azure Python Web App内部服务器错误

[英]Azure Python Web App Internal Server Error

编辑:问题似乎是在我的应用程序中导入包。 所有软件包都已正确安装,我可以在带有Kudu的wwwroot中看到它们。 但是,当我将它们导入脚本时,出现500错误。 最奇怪的是,仅当我以这种方式导入软件包时,才会出现问题:

from package import something

但不是这样:

import package

当我尝试调用包函数时,我也遇到相同的错误,这意味着我无法访问包中的任何内容(?)

似乎在Web应用程序中生成了一个异常,但在我的本地计算机中却没有。 有什么想法吗?


我试图在Azure Web Apps中发布Python Web App,但是我一直失败。 我正在使用bottle作为Web框架,我安装的软件包以及它们的依赖项是:

  • 脾气暴躁的
  • 西皮
  • Scikit图片

我已经配置了虚拟环境以匹配Web应用程序(32位/2.7),并且按照这篇文章中的说明使用滚轮安装了软件包: https : //azure.microsoft.com/zh-cn/documentation/articles/web-站点python-创建-部署-瓶应用程序/

我正在通过VS和Azure SDK中的发布向导部署应用程序,并且一切正常。

应用启动时,出现500错误,控制台显示以下内容: 在此处输入图片说明

我的web.cofing是这样的:

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

任何帮助为何会​​发生这种情况?

最终,我开始工作了。 问题是我用来安装车轮的pip版本。 我升级到pip 8.11.1一切都按预期进行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM