[GH-ISSUE #481] import clip problem #406

Open
opened 2026-10-31 21:14:44 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @TK-relax on GitHub (Feb 12, 2025).
Original GitHub issue: https://github.com/openai/CLIP/issues/481

if install ftfy 6.3.1, import clip lead to error:
Traceback (most recent call last):
File "", line 1, in
File "D:\anaconda3\envs\ldm\lib\site-packages\clip_init_.py", line 1, in
from .clip import *
File "D:\anaconda3\envs\ldm\lib\site-packages\clip\clip.py", line 14, in
from .simple_tokenizer import SimpleTokenizer as Tokenizer
File "D:\anaconda3\envs\ldm\lib\site-packages\clip\simple_tokenizer.py", line 6, in
import ftfy
File "C:\Users\TK\AppData\Roaming\Python\Python38\site-packages\ftfy-6.3.1-py3.8.egg\ftfy_init
.py", line 23, in
from ftfy import bad_codecs, chardata, fixes
File "C:\Users\TK\AppData\Roaming\Python\Python38\site-packages\ftfy-6.3.1-py3.8.egg\ftfy\bad_codecs_init_.py", line 37, in
_CACHE: dict[str, codecs.CodecInfo] = {}
TypeError: 'type' object is not subscriptable

after I change ftfy6.3.1 to ftfy5.6, it works

Originally created by @TK-relax on GitHub (Feb 12, 2025). Original GitHub issue: https://github.com/openai/CLIP/issues/481 if install ftfy 6.3.1, import clip lead to error: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\anaconda3\envs\ldm\lib\site-packages\clip\__init__.py", line 1, in <module> from .clip import * File "D:\anaconda3\envs\ldm\lib\site-packages\clip\clip.py", line 14, in <module> from .simple_tokenizer import SimpleTokenizer as _Tokenizer File "D:\anaconda3\envs\ldm\lib\site-packages\clip\simple_tokenizer.py", line 6, in <module> import ftfy File "C:\Users\TK\AppData\Roaming\Python\Python38\site-packages\ftfy-6.3.1-py3.8.egg\ftfy\__init__.py", line 23, in <module> from ftfy import bad_codecs, chardata, fixes File "C:\Users\TK\AppData\Roaming\Python\Python38\site-packages\ftfy-6.3.1-py3.8.egg\ftfy\bad_codecs\__init__.py", line 37, in <module> _CACHE: dict[str, codecs.CodecInfo] = {} TypeError: 'type' object is not subscriptable after I change ftfy6.3.1 to ftfy5.6, it works
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#406
No description provided.