我有一个使用.Net Core 1.0(C#)构建的网站,并将其部署到Azure WebApp(32位模式)。
该应用程序使用了一些python脚本,因此我能够创建一个虚拟环境(3.4.1),并使用pip install numpy
成功安装了numpy(1.11.0)。
我面临的问题是我无法安装SciPy。由于我了解编译器问题,尝试pip install scipy
失败。
下一步尝试下载Christoph Gohlke的Windows的Python扩展程序包(from here),将其复制到我的Web应用程序中,然后尝试运行'pip install scipy-0.18.0-cp34-cp34m-win32.whl',但没有成功。我得到的错误是:
scipy-0.18.0-cp34-cp34m-win32.whl is not a supported wheel on this platform.
Storing debug log for failure in D:\home\pip\pip.log
pip.log包含以下内容:
scipy-0.18.0-cp34-cp34m-win32.whl is not a supported wheel on this platform.
Exception information:
Traceback (most recent call last):
File "D:\home\site\wwwroot\env\lib\site-packages\pip\basecommand.py", line 122, in main
status = self.run(options, args)
File "D:\home\site\wwwroot\env\lib\site-packages\pip\commands\install.py", line 257, in run
InstallRequirement.from_line(name, None))
File "D:\home\site\wwwroot\env\lib\site-packages\pip\req.py", line 167, in from_line
raise UnsupportedWheel("%s is not a supported wheel on this platform." % wheel.filename)
pip.exceptions.UnsupportedWheel: scipy-0.18.0-cp34-cp34m-win32.whl is not a supported wheel on this platform.
我已尝试创建Troubleshooting - Package Installation中所述的require.txt文件。但是,由于它不是python应用程序,而是dotNet Core C#,因此它似乎并不在乎require.txt文件,并且在deploy.cmd文件中也看不到任何内容。
最佳答案
@mdeblois,您的理解是正确的,请参阅以下官方解释。
在Azure上运行时,某些软件包可能无法使用pip安装。可能只是该软件包在Python软件包索引上不可用。可能是需要编译器(在Azure App Service中运行Web应用程序的计算机上没有编译器)。
对于这种情况,解决方案是您可以参考官方教程的Troubleshooting - Package Installation部分以了解如何处理。
关于python - 如何在Azure C#Web应用程序上安装SciPy?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38710158/