Azure Bottle Web 应用程序和 numpy
Azure Bottle web app and numpy
在我使用 NumPy 库发布 Bottle 网络应用后,它说
The page cannot be displayed because an internal server error has occurred.
在本地主机上它可以工作。我使用了
中描述的虚拟环境
Use numpy & scipy in Azure web role
但还是不行。有人可以帮我配置 azure-python-numpy 吗?
@Mr.Green,根据我的经验,首先,我的建议是您可以参考教程Creating web apps with Bottle in Azure以确保您的带有 Bottle 的 webapp 已在 Azure 上正确部署。
其次,如果您正在使用Visual Studio,您可以安装Python Visual Studio 的工具以在Azure 上进行远程调试,请参阅维基页面https://github.com/Microsoft/PTVS/wiki/Azure-Remote-Debugging 了解如何操作调试。
最后,这是最重要的。根据 troubleshooting of the tutorial, you need to download the numpy
wheel package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy 并为您的 python webapp 安装它以启用 numpy
在 Azure 上运行。因为像 numpy
这样的包是使用 pip
安装的,这需要机器上不可用的编译器 运行 Azure App Service 中的 Web 应用程序,只能安装 wheel 包。
注意:如果webapp还是不行,请检查numpy
包是否追加到python系统路径下,尝试添加下面的代码解决。
import sys, os
sys.path.append(os.path.join(os.getcwd(), "<numpy-package-path, such as 'site-package'>"))
在我使用 NumPy 库发布 Bottle 网络应用后,它说
The page cannot be displayed because an internal server error has occurred.
在本地主机上它可以工作。我使用了
中描述的虚拟环境Use numpy & scipy in Azure web role
但还是不行。有人可以帮我配置 azure-python-numpy 吗?
@Mr.Green,根据我的经验,首先,我的建议是您可以参考教程Creating web apps with Bottle in Azure以确保您的带有 Bottle 的 webapp 已在 Azure 上正确部署。
其次,如果您正在使用Visual Studio,您可以安装Python Visual Studio 的工具以在Azure 上进行远程调试,请参阅维基页面https://github.com/Microsoft/PTVS/wiki/Azure-Remote-Debugging 了解如何操作调试。
最后,这是最重要的。根据 troubleshooting of the tutorial, you need to download the numpy
wheel package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy 并为您的 python webapp 安装它以启用 numpy
在 Azure 上运行。因为像 numpy
这样的包是使用 pip
安装的,这需要机器上不可用的编译器 运行 Azure App Service 中的 Web 应用程序,只能安装 wheel 包。
注意:如果webapp还是不行,请检查numpy
包是否追加到python系统路径下,尝试添加下面的代码解决。
import sys, os
sys.path.append(os.path.join(os.getcwd(), "<numpy-package-path, such as 'site-package'>"))