Error message notebook_login

When I run this cell

from huggingface_hub import notebook_login

notebook_login()

in my jupyter notebook the UI for entering the token. Upon entering the token I get the following error message:


FileNotFoundError Traceback (most recent call last)
c:\users\david\pycharmprojects\jaentranslator\venv\lib\site-packages\huggingface_hub\commands\user.py in login_token_event(t)
380 token_widget.value = “”
381 clear_output()
→ 382 _login(HfApi(), token=token)
383
384 token_finish_button.on_click(login_token_event)

c:\users\david\pycharmprojects\jaentranslator\venv\lib\site-packages\huggingface_hub\commands\user.py in _login(hf_api, username, password, token)
413 raise ValueError(“Invalid token passed.”)
414
→ 415 hf_api.set_access_token(token)
416 HfFolder.save_token(token)
417 print(“Login successful”)

c:\users\david\pycharmprojects\jaentranslator\venv\lib\site-packages\huggingface_hub\hf_api.py in set_access_token(access_token)
487 @staticmethod
488 def set_access_token(access_token: str):
→ 489 write_to_credential_store(USERNAME_PLACEHOLDER, access_token)
490
491 @staticmethod

c:\users\david\pycharmprojects\jaentranslator\venv\lib\site-packages\huggingface_hub\hf_api.py in write_to_credential_store(username, password)
342
343 def write_to_credential_store(username: str, password: str):
→ 344 with subprocess.Popen(
345 “git credential-store store”.split(),
346 stdin=subprocess.PIPE,

C:\Users\david\AppData\Local\Programs\Python\Python39\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,

C:\Users\david\AppData\Local\Programs\Python\Python39\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] The system cannot find the file specified

I tired the account login as well, but get the same error message. I tried the following cell:

from huggingface_hub import HfApi, HfFolder

_AUTH_TOKEN = “{my token}”
api = HfApi()
api.set_access_token(_AUTH_TOKEN)

  • HfFolder.save_token(_AUTH_TOKEN)

and get basically the same error message.

When I run

!huggingface-cli login

it doesn’t terminate.

Is there another way to login or am I doing something wrong? Any help would be appreciated. Thanks.

Can you check if you have git installed by running git --version in cmd?

If it doesn’t exist installing that from here: Git - Downloading Package should fix the issue

I have git installed but still I’m getting the same error. Is there any other solution for this?

It’s a bug in Colab, which should be fixed now. You can also use

!huggingface-cli login

as an alternative way of logging in

I restarted my conda env and I’m able to login now, thanks !

2 Likes