When does “pip install” build a wheel?

后端 未结 3 1326
孤街浪徒
孤街浪徒 2021-01-04 00:44

I found that in different folders, sometimes pip install will build wheel which takes a lot of time, while sometimes it doesn\'t. I\'m not sure why and how to c

相关标签:
3条回答
  • 2021-01-04 01:15

    I got the answer, it is just the first time that the wheel will be build, after that, it will read from cache

    0 讨论(0)
  • 2021-01-04 01:22

    Today I encountered a problem where a package wasn't being installed properly because it turns out that its build process generates incorrect wheel packages, even though direct installation works just fine.

    I did a bit of poking around, and it turns out that as of now (pip == 8.1.2), there isn't a direct way to control whether or not pip will try to build a wheel out of a given package. I found the relevant source code, and apparently, the wheel build process is used if and only if:

    • the wheel module is importable
    • a cache directory is in use

    As a result of that logic, one can indirectly disable pip's use of wheel-based builds by passing --no-cache-dir on the install command line.

    0 讨论(0)
  • 2021-01-04 01:41

    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/

    0 讨论(0)
提交回复
热议问题