当前位置: 首页 > 知识库问答 >
问题:

Microsoft Azure Django Python安装错误枕头

杜轩昂
2023-03-14

我做了更多的阅读,并了解到Azure不能从环境中安装PIL或Pillow,因此需要安装在我的系统上,然后上传到Azure。我包含了一个名为“.skippythondeployment”的文件,这样它就不会擦除本地系统上设置的环境,但这样部署就会再次失败。

将代码推送到Azure时生成的日志的重要部分附在下面。

检测到的requirements.txt。您可以使用.skippythondeployment文件跳过特定于Python的步骤。从站点配置检测Python运行时检测到Python-2.7正在删除不兼容的虚拟环境。....................................................创建Python-2.7虚拟环境。

 Traceback (most recent call last):
   File "<string>", line 1, in <module>
   File "D:\home\site\wwwroot\env\build\pillow\setup.py", line 756, in <module>
     raise RequiredDependencyException(msg)
 __main__.RequiredDependencyException:

 The headers or library files could not be found for zlib,
 a required dependency when compiling Pillow from source.

 Please see the install instructions at:
    https://pillow.readthedocs.io/en/latest/installation.html


 Complete output from command D:\home\site\wwwroot\env\Scripts\python.exe -c "import setuptools,
 reading manifest file 'Pillow.egg-info\SOURCES.txt'    reading manifest template 'MANIFEST.in'    warning: no files found matching

“.sh”未找到与“DOCS_STATIC”匹配的以前包含的目录警告:未找到与“.Coveragerc”匹配的以前包含的文件警告:未找到与“.editorconfig”匹配的以前包含的文件警告:未找到与“.grandape.yaml”匹配的以前包含的文件警告:未找到与“.travis*”匹配的以前包含的文件警告:未找到与“appveyor.yml”匹配的以前包含的文件警告:未找到与“build_childners.sh”匹配的以前包含的文件警告:未找到与“tox.ini”匹配的以前包含的文件警告:未找到与“.git”匹配的以前包含的文件警告:未找到与“.pyc”匹配的以前包含的文件警告:未找到与“.pyc”匹配的以前包含的文件警告:未找到与“.pyc”匹配的以前包含的文件警告:未找到与“.pyc”匹配的以前包含的文件。所以“未找到与运行build_ext”的发行版写入清单文件“pillow.egg-info\sources.txt”匹配的以前

 The headers or library files could not be found for zlib,    a required dependency when compiling Pillow from source.

 Please see the install instructions at:

https://pillow.readthedocs.io/en/latest/installation.html

 Traceback (most recent call last):
 File "<string>", line 1, in <module>
 File "D:\home\site\wwwroot\env\build\pillow\setup.py", line 756, in <module>

 raise RequiredDependencyException(msg)    __main__.RequiredDependencyException:

 The headers or library files could not be found for zlib,    a required dependency when compiling Pillow from source.

 Please see the install instructions at:

https://pillow.readthedocs.io/en/latest/installation.html



 ----------------------------------------  Cleaning up...  ....................................................  Command

d:\home\site\wwwroot\env\scripts\python.exe-c“import setuptools,tokenize;file='d:\home\site\wwwroot\env\build\pillow\setup.py';exec(compile(getattr(tokenize,'open',open)(file).read().replace('\r\n','\n'),file,'exec'))”install--记录d:\local\temp\pip-nu1mtm-record\install-record.txt--单一版本-外部管理--compile--安装-headers d:\home\site\wwwroot\env\include\site\python2.7失败,:\home\site\wwwroot\env\build\pillow在D:\home\pip\pip.log中存储失败的调试日志。错误-更改提交到远程存储库但部署到网站失败。

谢谢你

共有1个答案

卫深
2023-03-14

您似乎在使用Azure Web Apps/App Services部署包含pillow包的Django应用程序,而pillow包似乎是您在requirements.txt中声明的,像pillow>=2.0.0

然而,不幸的是,在Azure App Services上使用pillow包存在两个问题。

>

  • Pillow包含C代码,在将应用程序部署到Azure中时需要编译这些代码。解决方案是,您需要构建一个Billow的wheel文件来将其添加到您的项目中,并在requirements.txt中声明wheel文件,请参阅Django的Azure offical教程的疑难解答-包安装一节来了解。

    Pillow作为Python的图像库需要GDI API和资源。在Azure应用服务上,任何GDI调用都受到限制和阻止,请看这里了解。

    因此部署Django应用程序的唯一方法是使用Azure VM。

  •  类似资料:
    • 我正在尝试用Python3.9在Windowsx64中安装pillow。Witout枕头,不幸的是,我不能安装matplotlib。 当我这样做时: 我得到这个错误: 第864行,在setup(文件“C:\Program Files\python39\lib\site-packages\setuptools_init_.py”中;第153行,在setup(**attrs)文件“C:\Program

    • 问题内容: 我正在尝试使用goinstall github.com/hoisie/web.go 安装web.go,但我不断收到有关该路径的错误。 goinstall确实可以正常工作,因为当我只输入goinstall时,我会得到它的选项列表。关于我在做什么错的任何想法吗? 都会 问题答案: 您需要安装git(http://git-scm.com)才能从git存储库中获取软件包。 干杯, 法比安

    • 我使用Linux Mint,我想安装sass。我已经通过“sudo apt install ruby”2.3版安装了ruby,然后,当我想通过“sudo gem install sass-no user install”安装sass时,我出现了以下错误:

    • 我正在运行npm来安装mnodesql,这是一个用于sql服务器驱动程序的npm库。我安装这个Windows Server 2012盒。 我已经安装了Visual C 2010、node gyp和Python 2.7.x.x作为依赖项,所有这些安装都是成功的。 当我运行npm install msnodesql时,我得到一个红色的大错误: (x86)\MSBuild\Microsoft.Cpp\v

    • 我正在尝试全局安装我刚刚发布的 npm 模块。每次我尝试从npm或文件夹安装时,我都会收到此错误。 我正在使用sudo,并且我已经三次检查了包中的所有东西,所有东西都应该正常工作。我四处搜索了一下,看到了几个类似的案例,但都没有得到解决。以下是我的尝试。 < li >升级NPM(< code > sudo NPM install-g NPM ) < li >清除全局npm缓存(< code>sud

    • 问题内容: 我正在通过sudo npm install ionic -g安装ionic 并得到以下错误 离子论坛中也列出了该问题:-https: //forum.ionicframework.com/t/installing-ionic-not- successful-solved/36050/7 我曾尝试多次更改节点,npm,cordova版本,但是每次遇到此错误时,我都认为这与版本无关。在某些