【问题标题】:Cannot pip download Python libraries offline for Linux server from Windows Machine无法从 Windows 机器为 Linux 服务器离线下载 Python 库
【发布时间】:2021-06-27 12:05:31
【问题描述】:

我正在尝试将 Flask 应用程序部署到未连接到 Internet 的 Redhat linux 服务器。

我为 python 版本 3.7 安装了 Anaconda,因为它是我的 Linux 服务器中可用的版本,然后激活虚拟环境。

然后我按照这个问题Could not find a version that satisfies the requirement <package>中的步骤进行操作,但是在下载过程中发生了很多问题,如下所示:

  1. 提取所需的依赖项pip freeze &gt; requirements.txt
  2. 在我的Win10机器pip download --only-binary=:all: --platform manylinux1_x86_64 --platform linux_x86_64 -r requirements.txt中下载requirement.txt文件中提取的依赖项

它给了:

ERROR: Could not find a version that satisfies the requirement dlib==19.7.0 (from versions: none) ERROR: No matching distribution found for dlib==19.7.0

我从requirement.txt 中删除了dlib,然后它对gdown==3.10.0 显示相同的错误

从错误的模式来看,我认为问题在于 pip 没有 linux 版本 在下载文件中,只有tar.gz https://pypi.org/project/gdown/#files https://pypi.org/project/dlib/19.17.0/#files

此外,每次我从requirements.txt 文件中删除依赖项时,都会显示很多问题

ERROR: Could not find a version that satisfies the requirement gdown>=3.10.1 (from deepface) (from versions: none)
ERROR: No matching distribution found for gdown>=3.10.1

我的问题是,将依赖项下载到离线服务器的最佳方式是什么? 并管理python中的嵌套依赖项? 注意:这里是requirements.txt文件内容https://pastebin.com/2T9SLhhC

【问题讨论】:

  • 对于 RedHat,您可以将 RPM 下载到本地存储库并从那里安装。
  • RPM 是什么意思? @斯塔克
  • 你试过没有--only-binary=:all:标志吗?
  • @user1511208 我很困惑,该命令包含--only-binary 标志,我的问题是省略它。那么错误会改变吗?

标签: python pip


【解决方案1】:

dlib 不是 deepface 的必备要求。查看其所需的依赖项here

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多