[GH-ISSUE #243] ModuleNotFoundError: No module named 'CLIP' #212

Closed
opened 2026-10-31 21:12:30 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @catgrassgb6 on GitHub (May 5, 2022).
Original GitHub issue: https://github.com/openai/CLIP/issues/243

Hi all i have a problem here, i have installed clips but why is it still appearing and how should i fix this
ModuleNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2788/39159338.py in
29 try:
---> 30 from CLIP import clip
31 except:

ModuleNotFoundError: No module named 'CLIP'

During handling of the above exception, another exception occurred:

FileNotFoundError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_2788/39159338.py in
31 except:
32 if not os.path.exists("CLIP"):
---> 33 gitclone("https://github.com/openai/CLIP")
34 sys.path.append(f'{PROJECT_DIR}/CLIP')
35

~\AppData\Local\Temp/ipykernel_2788/2333243989.py in gitclone(url)
3
4 def gitclone(url):
----> 5 res = subprocess.run(['git', 'clone', url], stdout=subprocess.PIPE).stdout.decode('utf-8')
6 print(res)
7

E:\AIAI\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs)
503 kwargs['stderr'] = PIPE
504
--> 505 with Popen(*popenargs, **kwargs) as process:
506 try:
507 stdout, stderr = process.communicate(input, timeout=timeout)

E:\AIAI\lib\subprocess.py in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask)
949 encoding=encoding, errors=errors)
950
--> 951 self._execute_child(args, executable, preexec_fn, close_fds,
952 pass_fds, cwd, env,
953 startupinfo, creationflags, shell,

E:\AIAI\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session)
1418 # Start the process
1419 try:
-> 1420 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1421 # no special security
1422 None, None,

FileNotFoundError: [WinError 2] 系統找不到指定的檔案。

Originally created by @catgrassgb6 on GitHub (May 5, 2022). Original GitHub issue: https://github.com/openai/CLIP/issues/243 Hi all i have a problem here, i have installed clips but why is it still appearing and how should i fix this ModuleNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_2788/39159338.py in <module> 29 try: ---> 30 from CLIP import clip 31 except: ModuleNotFoundError: No module named 'CLIP' During handling of the above exception, another exception occurred: FileNotFoundError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_2788/39159338.py in <module> 31 except: 32 if not os.path.exists("CLIP"): ---> 33 gitclone("https://github.com/openai/CLIP") 34 sys.path.append(f'{PROJECT_DIR}/CLIP') 35 ~\AppData\Local\Temp/ipykernel_2788/2333243989.py in gitclone(url) 3 4 def gitclone(url): ----> 5 res = subprocess.run(['git', 'clone', url], stdout=subprocess.PIPE).stdout.decode('utf-8') 6 print(res) 7 E:\AIAI\lib\subprocess.py in run(input, capture_output, timeout, check, *popenargs, **kwargs) 503 kwargs['stderr'] = PIPE 504 --> 505 with Popen(*popenargs, **kwargs) as process: 506 try: 507 stdout, stderr = process.communicate(input, timeout=timeout) E:\AIAI\lib\subprocess.py in __init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask) 949 encoding=encoding, errors=errors) 950 --> 951 self._execute_child(args, executable, preexec_fn, close_fds, 952 pass_fds, cwd, env, 953 startupinfo, creationflags, shell, E:\AIAI\lib\subprocess.py in _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session) 1418 # Start the process 1419 try: -> 1420 hp, ht, pid, tid = _winapi.CreateProcess(executable, args, 1421 # no special security 1422 None, None, FileNotFoundError: [WinError 2] 系統找不到指定的檔案。
Author
Owner

@jongwook commented on GitHub (May 5, 2022):

You seem to be using a notebook unaffiliated with us, and the error is likely complaining that you don't have git installed and accessible in PATH.

The recommended way to install CLIP is to follow README.md, after which you can just import clip. Feel free to try Colab instead, in case setting up CLIP locally doesn't work.

<!-- gh-comment-id:1118867093 --> @jongwook commented on GitHub (May 5, 2022): You seem to be using a notebook unaffiliated with us, and the error is likely complaining that you don't have `git` installed and accessible in `PATH`. The recommended way to install CLIP is to follow [`README.md`](https://github.com/openai/CLIP/blob/main/README.md), after which you can just `import clip`. Feel free to try Colab instead, in case setting up CLIP locally doesn't work.
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#212
No description provided.