找不到满足 Pillow==2.7.0 要求的版本
Could not find a version that satisfies the requirement Pillow==2.7.0
我有一个 requirements.txt 文件,其中包含以下行
Pillow==2.7.0
我像这样下载离线模式的要求,并将其放入 vendor director
pip install --download vendor -r requirements.txt
这会将文件 Pillow-2.7.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel
下载到我的 vendor
目录
但是当我尝试部署(推送)我的应用程序时,出现以下错误:
Collecting Pillow==2.7.0 (from -r requirements.txt (line 4))
Could not find a version that satisfies the requirement Pillow==2.7.0 (from -r requirements.txt (line 4)) (from versions: )
No matching distribution found for Pillow==2.7.0 (from -r requirements.txt (line 4))
我正在按照本文档 http://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring
使用 Python Buildpack 将应用程序部署到 Cloud Foundry
更新:另一个 post 指出了如何为最新版本的 pip 指定一个不拉取二进制文件的标志(我假设这是问题所在)。如果这样可以解决问题,那么您应该选择他的 post 作为解决方案。我还会戳 cloudfoundry 只是需要指出这一点。
--download
选项只是下载依赖项的文件,而不是实际安装它(这可能是为什么不推荐使用该标志的原因,以消除这种混淆)。
pip download replaces the --download option to pip install, which is now deprecated and will be removed in pip 10.
和更新的一样:
pip download ....
https://pip.pypa.io/en/stable/reference/pip_download/
现在假设您的云提供商正在阅读 requirements.txt 并在您的供应商文件夹中查找自己以进行安装(一种不太明智的方法),您可能会遇到各种问题二进制文件、符号链接等...除非您要部署的环境与本地环境相匹配。像 pip 和需求文件这样的包系统的部分想法是,不同的平台可以为他们的特定架构提取所需的库,OS,等等...
这种方法有很多地方可能出错...
例如,您的 mac 可能正在使用不区分大小写的文件系统。如果 cloudfoundry 使用 linux,则区分大小写。在 mac 上,如果他们将其全部保存为小写并不重要,但在将文件复制到 linux 系统并希望匹配大写 "P" 时可能会出现问题。
在 http://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring 的示例中,您可以看到以下评论
vendors all the pip *.tar.gz into vendor/
*.tar.gz
包是源包,而最新版本的 pip 默认下载二进制包。要强制 pip 下载 仅 源包,请使用 --no-binary :all:
如果要下载二进制包,则必须根据 pip download
[=22] 中的注释指定目标平台=]:
pip download
with the --platform
, --python-version
,
--implementation
, and --abi
options provides the ability to fetch
dependencies for an interpreter and system other than the ones that
pip is running on. --only-binary=:all:
is required when using any of
these options. It is important to note that these options all default
to the current system/interpreter, and not to the most restrictive
constraints (e.g. platform any, abi none, etc). To avoid fetching
dependencies that happen to match the constraint of the current
interpreter (but not your target one), it is recommended to specify
all of these options if you are specifying one of them.
我有一个 requirements.txt 文件,其中包含以下行
Pillow==2.7.0
我像这样下载离线模式的要求,并将其放入 vendor director
pip install --download vendor -r requirements.txt
这会将文件 Pillow-2.7.0-cp27-none-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel
下载到我的 vendor
目录
但是当我尝试部署(推送)我的应用程序时,出现以下错误:
Collecting Pillow==2.7.0 (from -r requirements.txt (line 4))
Could not find a version that satisfies the requirement Pillow==2.7.0 (from -r requirements.txt (line 4)) (from versions: )
No matching distribution found for Pillow==2.7.0 (from -r requirements.txt (line 4))
我正在按照本文档 http://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring
使用 Python Buildpack 将应用程序部署到 Cloud Foundry更新:另一个 post 指出了如何为最新版本的 pip 指定一个不拉取二进制文件的标志(我假设这是问题所在)。如果这样可以解决问题,那么您应该选择他的 post 作为解决方案。我还会戳 cloudfoundry 只是需要指出这一点。
--download
选项只是下载依赖项的文件,而不是实际安装它(这可能是为什么不推荐使用该标志的原因,以消除这种混淆)。
pip download replaces the --download option to pip install, which is now deprecated and will be removed in pip 10.
和更新的一样:
pip download ....
https://pip.pypa.io/en/stable/reference/pip_download/
现在假设您的云提供商正在阅读 requirements.txt 并在您的供应商文件夹中查找自己以进行安装(一种不太明智的方法),您可能会遇到各种问题二进制文件、符号链接等...除非您要部署的环境与本地环境相匹配。像 pip 和需求文件这样的包系统的部分想法是,不同的平台可以为他们的特定架构提取所需的库,OS,等等...
这种方法有很多地方可能出错...
例如,您的 mac 可能正在使用不区分大小写的文件系统。如果 cloudfoundry 使用 linux,则区分大小写。在 mac 上,如果他们将其全部保存为小写并不重要,但在将文件复制到 linux 系统并希望匹配大写 "P" 时可能会出现问题。
在 http://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring 的示例中,您可以看到以下评论
vendors all the pip *.tar.gz into vendor/
*.tar.gz
包是源包,而最新版本的 pip 默认下载二进制包。要强制 pip 下载 仅 源包,请使用 --no-binary :all:
如果要下载二进制包,则必须根据 pip download
[=22] 中的注释指定目标平台=]:
pip download
with the--platform
,--python-version
,--implementation
, and--abi
options provides the ability to fetch dependencies for an interpreter and system other than the ones that pip is running on.--only-binary=:all:
is required when using any of these options. It is important to note that these options all default to the current system/interpreter, and not to the most restrictive constraints (e.g. platform any, abi none, etc). To avoid fetching dependencies that happen to match the constraint of the current interpreter (but not your target one), it is recommended to specify all of these options if you are specifying one of them.