PCAP Modules and Packages Practice Question
A developer wants to distribute a package that contains both Python code and data files (e.g., images, configs). Which file is used to specify dependencies and metadata for the package?
⚠ Common exam trap
PCAP often tests the confusion between setup.py and requirements.txt, where candidates might think requirements.txt is used for package metadata, but it is only for dependency listing.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
setup.py
setup.py is the standard file used to specify metadata and dependencies for a Python package. It contains information such as the package name, version, author, and a list of required packages (install_requires). It is used by setuptools to build and distribute the package.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
setup.py
Why this is correct
setup.py is the standard configuration and build script for Python packages, used by setuptools (or distutils) to define all distribution metadata—such as the package name, version, description, authors, and, crucially, dependencies via the `install_requires` keyword. When a developer runs commands like `python setup.py sdist` or `bdist_wheel`, this file is the source of truth for what goes into the package and what dependencies it declares, making it the correct place to specify the dependency on the other custom module.
- ✗
MANIFEST.in
Why it's wrong here
MANIFEST.in is a template file that instructs the source distribution (sdist) builder which additional files to include—like README, license, or data files—that are not automatically picked up from Python source files. It does not, and cannot, declare package dependencies or any distribution metadata; it only controls file inclusion for the archive, not the package's runtime requirements.
- ✗
__init__.py
Why it's wrong here
__init__.py is merely a marker that tells Python a directory should be treated as a package, and it can optionally run package initialization code when the package is imported. It contains no distribution metadata or dependency information, and it is never read by packaging tools to determine what other modules or libraries the package needs, so it is irrelevant to the distribution's dependency declaration.
- ✗
requirements.txt
Why it's wrong here
requirements.txt is a plain-text file used by `pip install -r` to install a curated set of packages into a specific environment, often with pinned versions for reproducible setups. It is not part of the package metadata and is not referenced when building a distribution; in fact, dependency information for distribution should live in setup.py's `install_requires` (or similar declarative metadata), making requirements.txt inappropriate for defining the package's required external module.
Go deeper
Related to this question
About these practice questions
Courseiva writes every PCAP question from scratch — 421 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Python Institute exam blueprint
This PCAP practice question is part of Courseiva's free Python Institute certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCAP exam.