在哪种情况下,pip安装了安装轮? [英] In which case pip install building wheel?

查看:210
本文介绍了在哪种情况下,pip安装了安装轮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现在不同的文件夹中,有时"pip install"会花费很多时间构建wheel,而有时却不需要.我不确定为什么会这样以及如何控制它.任何人都可以为此提供帮助.

I found that in different folders, sometimes "pip install" will build wheel which take a lot of time, while sometimes it won't. I'm not sure why's that and how to control that. Anyone can help on this.

我使用的命令是:"bin/python -m pip install -r ../requirements.txt"(由于shebang行长的限制,因此请不要直接使用pip)

The command I use: "bin/python -m pip install -r ../requirements.txt" (due to shebang line length limitation, so don't use pip directly)

不带轮子的输出(只需花费几秒钟)

The output without building wheel (just take a few seconds)

Collecting numpy==1.10.4 (from -r ../requirements.txt (line 1))
Installing collected packages: numpy
Successfully installed numpy-1.10.4

带轮子的输出(至少需要2分钟)

The output with building wheel (take at least 2 minutes)

Collecting numpy==1.10.4 (from -r ../requirements.txt (line 1))
  Downloading numpy-1.10.4.tar.gz (4.1MB)
    100% |████████████████████████████████| 4.1MB 92kB/s
Building wheels for collected packages: numpy
  Running setup.py bdist_wheel for numpy ... done
  Stored in directory: /root/.cache/pip/wheels/66/f5/d7/f6ddd78b61037fcb51a3e32c9cd276e292343cdd62d5384efd
Successfully built numpy
Installing collected packages: numpy
Successfully installed numpy-1.10.4

requirements.tt

The contents of requirements.tt

numpy==1.10.4

推荐答案

这取决于您的软件包是纯python软件包(无需编译任何东西,只需将文件复制到某个地方)还是包含c源代码的软件包代码(在这种情况下,必须进行编译,并且调用并执行编译器会花费更长的时间).

This depends on whether your package is a pure python package (without the need to compile anything, just copy the files somewhere) or a package which also includes c source code (in which case a compilation is necessary and a compiler is called and executed, which takes longer).

http://pythonwheels.com/

您可能还想看看轮盘文档:

You may also want to have a look at the wheel docu:

http://wheel.readthedocs.org/en/latest/

这篇关于在哪种情况下,pip安装了安装轮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆