mirror of
https://github.com/openai/CLIP.git
synced 2026-11-05 01:37:26 +00:00
[PR #535] [CLOSED] fix: remove pkg_resources dependency in setup.py (breaks on setuptools 71+) #529
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openai/CLIP#529
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/openai/CLIP/pull/535
Author: @Aadi775
Created: 3/22/2026
Status: ❌ Closed
Base:
main← Head:patch-1📝 Commits (2)
aac299aUpdate setup.py47aaee3Apply suggestion from @Copilot📊 Changes
1 file changed (+4 additions, -3 deletions)
View changed files
📝
setup.py(+4 -3)📄 Description
Problem
When installing CLIP via pip on systems with setuptools 71+, the installation fails with:
This happens because pip creates an isolated build environment in a temporary directory when building packages from source. In this isolated environment, setuptools is installed fresh. and in newer versions (71+),
pkg_resourcesis no longer automatically available as a top-level importable module within that subprocess context, even though setuptools itself is present.The original
setup.pyimportedpkg_resourcesat the module level and usedpkg_resources.parse_requirements()to readrequirements.txt. Since this code runs inside pip's isolated build subprocess, it fails before the wheel can even be built , making CLIP completely uninstallable from source on modern systems without workarounds.What Changed
Before:
After:
Replaced
pkg_resources.parse_requirements()with plain Python file I/O. No external dependencies, same result. Also adds explicit filtering of blank lines and comment lines (#), which the original did not handle.Impact
pkg_resourcesdependency fromsetup.py🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.