ERROR pip install_error ai_generated true

ERROR: Package 'X' has no 'pyproject.toml' or 'setup.py'

ID: pip/package-has-no-pyproject-toml-or-setup-py

Also available as: JSON · Markdown · 中文
80%Fix Rate
85%Confidence
1Evidence
2023-05-10First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
pip 21.3+ active
Python 3.7-3.12 active

Root Cause

The package is either not a valid Python package, the index URL is wrong, or the package name is misspelled, causing pip to fail to find any build metadata.

generic

中文

该包要么不是有效的 Python 包,要么索引 URL 错误,或者包名拼写错误,导致 pip 无法找到任何构建元数据。

Official Documentation

https://pip.pypa.io/en/stable/topics/packaging/

Workarounds

  1. 70% success pip install --no-index --find-links=/path/to/wheels <package>
    pip install --no-index --find-links=/path/to/wheels <package>
  2. 75% success pip install <package>==<exact_version> --only-binary=:all:
    pip install <package>==<exact_version> --only-binary=:all:
  3. 85% success pip install <package> -i https://pypi.org/simple/ --trusted-host pypi.org
    pip install <package> -i https://pypi.org/simple/ --trusted-host pypi.org

中文步骤

  1. pip install --no-index --find-links=/path/to/wheels <包名>
  2. pip install <包名>==<确切版本> --only-binary=:all:
  3. pip install <包名> -i https://pypi.org/simple/ --trusted-host pypi.org

Dead Ends

Common approaches that don't work:

  1. Installing the package with --no-build-isolation flag 95% fail

    The flag only disables build isolation; if the package has no build files at all, this still fails.

  2. Upgrading pip to the latest version 90% fail

    The error is about missing package metadata, not pip's resolver or version compatibility.

  3. Running pip install with --verbose to get more details 85% fail

    Verbose output does not provide missing build files; the root cause remains the same.