DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

Why Files Are Missing from a Python Wheel—and How to Fix Package Discovery

Missing wheel files usually come down to package discovery or runtime data inclusion. Learn which setuptools setting to change and how to inspect the rebuilt wheel.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Files go missing from a Python wheel for two main reasons: setuptools did not discover the Python package or module, or it did not include the package’s runtime data files. These are separate problems with separate configuration. First identify what kind of file is missing, then configure discovery or data inclusion for your project’s layout, rebuild, and inspect the wheel itself.

First identify what kind of file is missing

A wheel is the installable artifact; the source distribution (sdist) is a separate archive that can also contain tests, documentation, examples, and build inputs. A file appearing in the sdist does not prove it will appear in the wheel. The Python Packaging Authority states that “MANIFEST.in does not affect binary distributions such as wheels.”

  • A package directory or Python module is missing: check package discovery and module declarations.
  • A non-Python file inside a package is missing: configure package data or manifest/VCS-based inclusion.
  • A file outside a package is missing: reconsider whether it belongs inside the importable package; include_package_data includes files inside package directories in the wheel by default.
  • A test, document, or example is missing: it may intentionally be present only in the sdist, not the runtime wheel.

Fix Python package and module discovery

Match the finder to the project layout

With setuptools, package discovery is configured through packages or automatic finder rules. For example, the PyPA guide demonstrates find_packages(include=['sample', 'sample.*']); adjust include and exclude patterns to match the intended package tree. If the package lives under src/, configure the finder’s root accordingly rather than searching the repository root. Setuptools’ data-files examples use where = ["src"] for this layout; legacy setup.py configuration can map it with package_dir={"": "src"}.

Declare standalone modules

A single top-level .py file that is not inside a package is a module, not a discovered package directory. Declare its module name, without the extension, in py_modules. The distinction and discovery examples are covered in the PyPA setuptools distribution guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check automatic discovery and namespace packages

Setuptools’ flat-layout finder excludes certain names and refuses ambiguous distributions with multiple top-level packages by default. If a multi-package layout is intentional, configure discovery explicitly. In pyproject.toml, tool.setuptools.packages.find considers implicit namespace packages by default; set namespaces = false only when the project does not use them. See setuptools package discovery.

Include non-Python runtime files

Prefer explicit package-data patterns when the files are known

For files such as JSON, text, or templates stored inside an importable package, setuptools’ package_data patterns provide a direct inclusion rule. A src-layout example is:

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools.package-data]
mypkg = ["*.json", "*.txt"]

Replace mypkg and the patterns with the actual package name and runtime files. Patterns do not match dotfiles unless the pattern explicitly begins with a dot. For nested paths, use / as the separator on every platform. These rules are documented in setuptools data files.

Use manifest or VCS inclusion deliberately

include_package_data can include package files that are listed by MANIFEST.in or collected by an enabled version-control-system plugin. In pyproject.toml, this setting has defaulted to true since setuptools 61.0.0; in setup.cfg and setup.py, the default remains false for backwards compatibility. Explicit package-data patterns make the selection easier to reason about. A manifest can help place files in an sdist, but it is not by itself a wheel inclusion rule.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Reconsider files stored outside the package

Runtime resources are generally easiest to distribute alongside the package that loads them. Setuptools’ data_files supports some files installed outside packages, but the documentation describes it as mostly useful for files consumed by other programs. Choose it only when that installation location is actually needed; do not expect include_package_data to gather arbitrary files from elsewhere in the repository.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Build and inspect the wheel, not just the source tree

  1. Confirm the backend. Open pyproject.toml and check [build-system]. Setuptools options do not configure Hatch, Flit, PDM, Poetry, or another backend; use that backend’s own inclusion rules. The PyPA packaging tutorial explains the build configuration and artifact workflow.
  2. Match configuration to the tree. For example, if the package is at src/mypkg/__init__.py, ensure discovery searches src. Declare standalone modules separately.
  3. Add the appropriate data rule. Use package-data patterns for known runtime files, or configure manifest/VCS inclusion when that is the intended mechanism. Do not assume an sdist manifest alone puts files in the wheel.
  4. Clear stale outputs after changing files or configuration. Remove build, dist, and *.egg-info before rebuilding. Setuptools notes that *.egg-info/SOURCES.txt can also act as a cache after package-data changes.
  5. Build and inspect the archive. Run python3 -m build --wheel source-tree-directory, replacing the directory with the project’s source-tree path. A .whl is a ZIP-format archive. Check that it contains the expected installable paths; wheel contents are installed into purelib or platlib, commonly site-packages, alongside distribution metadata.

For a final check, compare the expected importable package paths and runtime resources with the actual archive contents. The wheel specification describes the archive layout. It also notes that a wheel does not contain setup.py or setup.cfg; their absence is not evidence of a failed build.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.