简体   繁体   中英

What do I need to do to fix "ERROR: Could not build wheels which use PEP 517 and cannot be installed directly"?

I am building a library that follows standard practices when it comes to development, testing and release (using tox and pytest, setup.cfg, etc). Sometime this morning, I suddenly started getting the following error when I attempt to run my tests and I am stumped as to the root cause.

Building wheels for collected packages: python-step-series
  Building wheel for python-step-series (PEP 517): started
  Building wheel for python-step-series (PEP 517): finished with status 'done'
  Created wheel for python-step-series: filename=python_step_series-0.0.2.dev1.post1.dev0_g1f5fc90.d20211206-py3-none-any.whl size=17943 sha256=6db044ba1828101d1ecd7f27be55a42b63711d537a6ea01d4935eaa4122655ef
  Stored in directory: /home/user/.cache/pip/wheels/46/6f/be/601a51d80e3889cae97cbe8b1a98cc4be1004f1e97546d94ef
  WARNING: Built wheel for python-step-series is invalid: Metadata 1.2 mandates PEP 440 version, but '0.0.2.dev1.post1.dev0-g1f5fc90.d20211206' is not
Failed to build python-step-series
ERROR: Could not build wheels for python-step-series which use PEP 517 and cannot be installed directly

I know it has something to do with git tagging and the fact that my working tree is dirty, but how to fix this is beyond me. Until this morning, I never had an issue. Creating a new tag every time I want to run my tests (using tox) seems to band-aid this--until my working tree becomes dirty again. Regardless, this band-aid isn't efficient nor proper.

I'm using tox-conda instead of virtualenv, but each environment is reporting Pip version: 21.2.4 (python 3.7,3.8, 3.9. 3.10)

Has anyone else encountered or have knowledge of this issue and how to fix it?

I decided to wipe out my environment completely for a third time as well as delete pip's cache. Apparently, whatever was causing this issue lived in pip's cache or the "third time's the charm" superstition came true.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM