【问题标题】:Pypi / pip blocks while downloading grpcio-reflection下载 grpcio-reflection 时 Pypi / pip 阻塞
【发布时间】:2017-10-11 10:57:04
【问题描述】:

用 pip 安装grpcio-reflection 需要很长时间。

这很奇怪,因为 pip 包在 PyPI 中只有 8KB,但下载需要一分钟多,而其他兆字节的包下载速度非常快。

更新: 它没有下载,有很多编译正在进行。似乎该功能仍处于 alpha 阶段,因此该包没有像标准 grpcio 那样预编译

UPDATE2:复制步骤

我刚刚在这里打开了一个问题:https://github.com/grpc/grpc/issues/12992,我正在复制此处的重现步骤以完成。

grpci-reflection 包安装似乎冻结,取决于同一命令行中的其他包

这可以通过这两个 docker 不同的容器轻松复制:

Dockerfile.fast - 容器创建时间 ~1m 23s

#Download base ubuntu image
FROM ubuntu:16.04
RUN apt-get update && \
    apt-get -y install ca-certificates curl

# Prepare pip 
RUN apt-get -y install python-pip
RUN pip install -U pip
RUN pip install grpcio grpcio-tools
RUN pip install grpcio-reflection         # Two lines is FAST

Dockerfile.slow - 容器创建时间 5m 20s

#Download base ubuntu image
FROM ubuntu:16.04
RUN apt-get update && \
    apt-get -y install ca-certificates curl

# Prepare pip
RUN apt-get -y install python-pip
RUN pip install -U pip
RUN pip install grpcio grpcio-tools grpcio-reflection  # Single line is SLOW

定时容器构建时间:

time docker build --rm --no-cache -f Dockerfile.fast -t repro_reflbug_fast:latest .
......
real    1m22.295s
user    0m0.060s
sys     0m0.040s

time docker build --rm --no-cache -f Dockerfile.slow -t repro_reflbug_slow:latest .
.....
real    6m28.290s
user    0m0.052s
sys     0m0.052s
.....

我还没来得及调查,但是第二个案例阻塞了很长时间,而第一个没有。

【问题讨论】:

  • 下载似乎很快,但之后安装似乎减慢几乎停止。我没有看为什么(还)。某些依赖项可能存在问题 - 包将 cythonprotobuf 列为依赖项。
  • 您在什么平台上工作?使用什么版本的pip?您是否使用虚拟环境(建议这样做),如果是,使用哪个版本的virtualenvgrpcio-reflection 是纯 Python,因此(前提是您分别安装了 grpcioprotobuf)安装它时不应该进行任何编译。
  • @NathanielManistaAtGoogle 您好 Nathaniel,感谢您的关注。我已经更新了问题,添加了重现步骤,还在 github 中创建了一张票。如果您需要更多详细信息,请告诉我。
  • 谢谢;让我们继续调查issue 12992
  • @NathanielManistaAtGoogle 很抱歉使用此频道提问,但这个问题是否有意义,或者只是我做错了什么? github.com/grpc/grpc/issues/13010

标签: python pip grpc pypi


【解决方案1】:

事实证明,这个问题在相应的 GitHub 存储库中被接受为有效。现在在这里讨论:

https://github.com/grpc/grpc/issues/12992

【讨论】:

    猜你喜欢
    • 2012-04-23
    • 1970-01-01
    • 2019-10-14
    • 2022-06-13
    • 2019-03-25
    • 1970-01-01
    • 2016-07-04
    • 2015-08-06
    • 2012-12-11
    相关资源
    最近更新 更多