I had the same error previously and it's caused by a dependency not directly related to pip that's missing, In my case I had to install rust dependency and restart the terminal
As indicated by @Treasure Olayinka it's mostly related to "twobody" and "pyproject.toml"