You get this error because pip must run code inside the CLIP source tree to discover its build requirements, and that step fails for reasons pip cannot attribute to its own logic. The "not a problem with pip" clause means the fault lies in build isolation, the source checkout, or a missing system toolchain. Fixing it means switching CLIP to an editable Git install or supplying the exact dependency versions the old source expects.

What pip is actually doing when that line appears

Pip follows a two-phase process for source distributions and bare Git archives. First it resolves dependencies. Then, before it builds the wheel, it runs the package's declared requirement hook, usually setup.py or a pyproject.toml backend, inside an isolated build environment. That environment contains only the build backend and whatever the package declares for build time.

CLIP's historical repository predates pyproject.toml. Its requirements live in setup.py and a matching requirements.txt. When pip runs get_requires_for_build_wheel, it executes that setup machinery and parses the dependency list. If any of those steps raise, pip reports the subprocess failure verbatim. The phrase "when getting requirements to build wheel" is pip telling you precisely where the crash occurred, not what broke.

The distinction matters because pip's own install logic never fails here. The isolated environment spawns a child process, that child dies, and pip relays the traceback. Your real error is in the traceback above the quoted line, usually a missing module, a failed import, or an incompatible setuptools API.

Why the "not a problem with pip" message is accurate

Pip is a courier, not a compiler. It downloads, isolates, and invokes. The build backend does the work. When the backend raises, pip's message says so to stop you from filing a pip bug report. That is also why upgrading pip rarely helps with this specific error.

The common root causes cluster into four groups. A pinned dependency in the old CLIP source no longer resolves against a current index. The isolated environment lacks setuptools or wheel at a version the legacy setup script expects. The system compiler or C headers are missing on platforms where a dependency has no wheel. Or the source archive itself is incomplete relative to the repository's expected layout.

A counterintuitive detail: installing torch first, by hand, into the same interpreter often changes the outcome. The isolated build environment does not inherit your global torch. But some legacy build hooks probe for torch and fail hard when the probe returns nothing, rather than declaring it as a requirement.

The dependency era problem, quantified

This error is a snapshot of a 2021-era repository interacting with a 2025-era package index. OpenAI's CLIP commit d50d76d is a fixed archive. Its requirements.txt typically lists torch, torchvision, ftfy, regex, and tqdm without upper bounds. Any of those packages has since released major versions with breaking API changes.

The resolution surface is wide. Even if you fix torch, the next dry run may surface a ftfy or regex mismatch, because pip resolves each layer again. Expect between one and four iterations before the requirements hook clears. That is not inefficiency. It is what happens when a frozen script meets a moving index.

Approach What it changes Reliability Best for
Git editable install Clones repo, uses current setup High Active development
Direct archive URL Uses frozen zip Low Reproducing bugs
Forked requirements Pins versions Medium Legacy environments
Conda package Skips pip build High Non-Python users
Manual deps then no-build-isolation Supplies env Medium Offline setups
Docker image Pins everything High Deployment

The table is the practical core of this fix. Pick a row that matches your goal, not the one that sounds most clever.

Timeline of how this failure reaches you

Stage Event Failure point
1 pip fetches the zip Network or redirect issue
2 pip creates isolated env Backend install fails
3 setup.py runs Missing import or syntax
4 requirements parsed Unresolvable pin
5 wheel build begins Compiler mismatch
6 Install completes Import-time API break
7 Runtime Silent version drift

Most users see the quoted message at stage 3 or 4. Fixing an earlier stage does not guarantee later stages will succeed. That is why rebuilding sometimes reveals a new error immediately.

Red-flag warnings and common traps

Treat this error as three errors wearing one coat, and watch for these failure modes.

Do not run the archive URL through pip again and expect a different result. The zip is byte-identical every time. Do not add --no-build-isolation without first installing every build-time dependency into the target environment. Do not pin torch to a version from 2021 without checking whether your Python interpreter is 3.11 or newer. Many old wheels do not exist for those versions. Do not install the same CLIP archive into two virtual environments without cleaning the cache, because pip's wheel cache can serve stale partial builds. Do not copy the error line into a bug report. Report the traceback above it, which names the actual module.

Practical actions that actually clear the error

Start by reading the traceback. Scroll to the first line that names a module or file, not the message pip quoted. That line is your real target.

Then install the source as an editable Git clone instead of the frozen archive. The command pip install -e "git+https://github.com/openai/CLIP.git#egg=clip" pulls the repository and runs its current setup. It does not guarantee a clean build, but it replaces the 2021 layout with whatever the maintainers ship today.

If you need the exact archive for reproducibility, download the zip, extract it, and inspect setup.py and requirements.txt directly. Edit the dependency pins in your local copy, then pipe it into pip from the filesystem path. This makes the change inspectable and reversible.

Remove the build cache before retrying, so a partial wheel does not mask progress. A failed build can leave artifacts that confuse the next attempt. Clearing the cache forces a clean resolution pass.

For C-extension compile failures, and only those, try disabling build isolation after confirming the build dependencies exist in your environment. Add them explicitly first. This bar is the stop-line for most users.

If Python version is the culprit, recreate the environment on Python 3.8 or 3.9, which matches the era. Old torch and torchvision wheels exist for those interpreters and do not for newer ones.

Misconceptions worth correcting

The single biggest misconception is that upgrading pip fixes this. Upgrading pip changes the courier, not the compiler. The second is that the archive URL is a stable install target. It bundles a setup script whose assumptions have aged out of the index. The third is that success is binary. A clean install of an old CLIP on a current PyTorch is possible but often fails at import, where tensor or device APIs have shifted. Fixing the build is half the job.

Limitations and where this reasoning stops

The fix depends on which CLIP commit, which Python interpreter, and which OS you are on. The guidance above addresses the mechanics of the build hook failure, not the behavioral compatibility of a frozen 2021 model repository running on a current machine. Version-pinned Docker images are the only reliable way to make that last part true.

This article is general technical information, not a guarantee of a working install on your specific system. If the environment is for production, security-sensitive inference, or a regulated workflow, route the setup through a qualified platform or machine-learning engineer who can verify the dependency chain end to end.