Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import packaging to be compatible with setuptools==70.0.0 #449

Merged
merged 2 commits into from
Jun 4, 2024

Conversation

JamieMartin
Copy link
Contributor

@JamieMartin JamieMartin commented Jun 3, 2024

As described in Issue #446 (#446), there is a change from setuptools 70.0.0 which causes breaking behaviour. This change fixes this. However, it will force the usage of setuptools 70.0.0.

In another PR, I've offered a solution which checks the version, which provides backward compatibility - #450

File ~/python3.12/site-packages/clip/clip.py:6
      5 from typing import Any, Union, List
----> 6 from pkg_resources import packaging
      8 import torch

ImportError: cannot import name 'packaging' from 'pkg_resources' (~/python3.12/site-packages/pkg_resources/__init__.py)

@JamieMartin
Copy link
Contributor Author

JamieMartin commented Jun 3, 2024

The above run failed because it's using setuptools version setuptools-69.5.1, yet the comment states that this approach REQUIRES setuptools 70.0.0 to be used.
https://github.com/openai/CLIP/actions/runs/9352249182/job/25742406920?pr=449#step:3:78

It may be better to use #450 instead if backward compatibility is desired. If so, please feel free to close this PR.

@jongwook jongwook merged commit dcba3cb into openai:main Jun 4, 2024
3 checks passed
@jongwook
Copy link
Collaborator

jongwook commented Jun 4, 2024

Thanks again for your contribution -- I prefer this PR because it's simpler, and it appears that with from packaging import version and the added dependency, it works okay with python 3.7, i.e. not losing backwards compatibility.

denis-ismailaj pushed a commit to denis-ismailaj/CLIP that referenced this pull request Jul 8, 2024
* import packaging to be compatible with setuptools==70.0.0

* importing the version module

---------

Co-authored-by: Jamie <Jamie@Alexandras-MacBook-Pro.local>
Co-authored-by: Jong Wook Kim <jongwook@nyu.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants