What is the meaning of “Failed building wheel for X” in pip install?

后端 未结 12 1059
执念已碎
执念已碎 2020-12-07 13:54

This is a truly popular question here at SO, but none of the many answers I have looked at, clearly explain what this error really mean, and why it occurs.

One sour

12条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-07 14:19

    It might be helpful to address this question from a package deployment perspective.

    There are many tutorials out there that explain how to publish a package to PyPi. Below are a couple I have used;

    medium
    real python

    My experience is that most of these tutorials only have you use the .tar of the source, not a wheel. Thus, when installing packages created using these tutorials, I've received the "Failed to build wheel" error.

    I later found the link on PyPi to the Python Software Foundation's docs PSF Docs. I discovered that their setup and build process is slightly different, and does indeed included building a wheel file.

    After using the officially documented method, I no longer received the error when installing my packages.

    So, the error might simply be a matter of how the developer packaged and deployed the project. None of us were born knowing how to use PyPi, and if they happened upon the wrong tutorial -- well, you can fill in the blanks.

    I'm sure that is not the only reason for the error, but I'm willing to bet that is a major reason for it.

提交回复
热议问题