Python 下载grpcio反射时Pypi/pip块

Python 下载grpcio反射时Pypi/pip块,python,pip,grpc,pypi,Python,Pip,Grpc,Pypi,使用pip安装grpcio反射需要很长时间 这很奇怪,因为pip包在PyPI中只有8KB,但下载需要一分钟以上,而其他兆字节的包下载速度非常快 更新: 它不是下载的,正在进行大量的编译。该特性似乎仍然是alpha格式的,因此包没有像标准的grpcio那样进行预编译 更新2:复制步骤 我刚刚在这里打开了一个问题:我在这里复制复制复制步骤以完成 grpci反射包安装似乎会冻结,这取决于同一命令行中的其他包 这可以通过这两个docker不同的容器轻松复制: Dockerfile.fast-容器创建时间

使用pip安装grpcio反射需要很长时间

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

更新: 它不是下载的,正在进行大量的编译。该特性似乎仍然是alpha格式的,因此包没有像标准的grpcio那样进行预编译

更新2:复制步骤

我刚刚在这里打开了一个问题:我在这里复制复制复制步骤以完成

grpci反射包安装似乎会冻结,这取决于同一命令行中的其他包

这可以通过这两个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-容器创建时间5米20秒

#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
.....

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

结果表明,该问题在相应的GitHub回购协议中被视为有效。现在正在这里讨论:


下载速度似乎很快,但在那之后,安装速度似乎减慢到几乎停止。我还没看清楚原因。可能有些依赖项有问题-软件包将cython和protobuf列为依赖项。您在哪个平台上工作?用什么版本的pip?您是否正在使用虚拟环境?如果是,建议使用哪个版本的VirtualEnvironment?grpcio反射是纯Python的,因此,如果您单独安装了grpcio和protobuf,则在安装它时不应进行任何编译。@NathanielManistaAtGoogle Hi Nathaniel,感谢您的关注。我已经更新了问题,添加了复制步骤,并在github中创建了一个记录单。如果您需要更多详细信息,请告诉我。谢谢;让我们继续调查。@NathanielmanistataatGoogle很抱歉使用此频道提问,但这个问题有意义吗?或者只是我做错了什么?