Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Heroku上的新部署失败,原因是;使用--允许未经验证的PIL允许;_Python_Django_Heroku_Pip - Fatal编程技术网

Python 在Heroku上的新部署失败,原因是;使用--允许未经验证的PIL允许;

Python 在Heroku上的新部署失败,原因是;使用--允许未经验证的PIL允许;,python,django,heroku,pip,Python,Django,Heroku,Pip,尝试将Django项目部署到Heroku上的一个新应用程序中(该代码在过去两年中一直在其他实例上运行),但遇到以下问题: Downloading/unpacking PIL==1.1.7 (from -r requirements.txt (line 7)) Could not find any downloads that satisfy the requirement PIL==1.1.7 (from -r requirements.txt (line 7)) Some

尝试将Django项目部署到Heroku上的一个新应用程序中(该代码在过去两年中一直在其他实例上运行),但遇到以下问题:

   Downloading/unpacking PIL==1.1.7 (from -r requirements.txt (line 7))

   Could not find any downloads that satisfy the requirement PIL==1.1.7 (from -r requirements.txt (line 7))

   Some insecure and unverifiable files were ignored (use --allow-unverified PIL to allow).
   Cleaning up...

   No distributions at all found for PIL==1.1.7 (from -r requirements.txt (line 7))
   Storing debug log for failure in /app/.pip/pip.log

   !     Push rejected, failed to compile Python app
我知道最近在
pip
中发生了变化,我希望使用安全的包,但在所有包都按照pip的期望正确打包之前,我们需要一些解决方法。特别是缺少--allow all unverified标志,这使得这是一个尝试和错误,通过黑盒练习而不是无痛部署

有没有一个明智的方法可以越过这个路障?(不仅仅是PIL,但这是第一个失败的软件包,如果我设法解决这个问题,还有其他几个像pyPdf一样的软件包将失败)


感谢任何指点

我问了pip的维护人员,他给出了一个简单的答案。作为对我自己问题的回答,我正在详细说明如何进行这项工作。以下是您现在需要做的事情—直到包在内部托管并经过验证

在本地计算机上,创建一个新的虚拟环境,并在
requirements.txt
文件顶部添加一行:

--允许所有外部

保存并运行:

pip安装-r requirements.txt——下载=“~/temp/packages”

这样做只需从
requirements.txt
中获取每个包名,然后将包下载到
~/temp/packages
目录中并进行验证

对于验证失败的每个包,在
requirements.txt
中添加另一行,就在允许所有外部包的第一行下方,如下所示:

--允许未验证的包名

您可能希望ping维护人员以修复此问题;)

继续,直到pip成功完成,然后将更新的
requirements.txt
提交给vcs并部署


应该就这些了。

是我一个人,还是这是一个耗时而痛苦的过程?如果你看看其他工具,比如npm或bundler,他们不会对未经验证一点都不在乎……不管怎样,他们只是在咆哮……对于像我这样的其他人来说:确保你也使用了足够新的pip版本……否则你可能会尝试一下失败。当我这样做的时候,有人特别告诉我,它找不到一些versionspec。升级pip本身让我克服了它。