ServiceStartProcessError at wandb.login()

I have an issue that seems to have been raised in a few other threads but for some reason none of those solutions are working for me. I am running wandb.login() in a jupyter notebook and receiving the following error:

Traceback (most recent call last):
  File "/private/var/tmp/_bazel_me/c6c153b8ee296ecf5ef55e689ef4faf0/external/python3_aarch64-apple-darwin/lib/python3.10/", line 187, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/private/var/tmp/_bazel_me/c6c153b8ee296ecf5ef55e689ef4faf0/external/python3_aarch64-apple-darwin/lib/python3.10/", line 146, in _get_module_details
    return _get_module_details(pkg_main_name, error)
  File "/private/var/tmp/_bazel_me/c6c153b8ee296ecf5ef55e689ef4faf0/external/python3_aarch64-apple-darwin/lib/python3.10/", line 110, in _get_module_details
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/", line 27, in <module>
    from wandb import sdk as wandb_sdk
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/sdk/", line 25, in <module>
    from .artifacts.artifact import Artifact
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/sdk/artifacts/", line 36, in <module>
    from wandb.apis.normalize import normalize_exceptions
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/apis/", line 43, in <module>
    from .internal import Api as InternalApi  # noqa
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/apis/", line 3, in <module>
    from wandb.sdk.internal.internal_api import Api as InternalApi
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/sdk/internal/", line 48, in <module>
    from ..lib import retry
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/sdk/lib/", line 17, in <module>
    from .mailbox import ContextCancelledError
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/sdk/lib/", line 10, in <module>
    from wandb.proto import wandb_internal_pb2 as pb
  File "/Users/me/.local/lib/python3.10/site-packages/wandb/proto/", line 1, in <module>
    import google.protobuf
ModuleNotFoundError: No module named 'google.protobuf'

ServiceStartProcessError                  Traceback (most recent call last)
Cell In[2], line 25
     22 from sklearn.pipeline import Pipeline
     23 from sklearn.preprocessing import StandardScaler
---> 25 wandb.login()

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in login(anonymous, key, relogin, host, force, timeout, verify)
     55 """Set up W&B login credentials.
     57 By default, this will only store the credentials locally without
     78     UsageError - if api_key cannot be configured and no tty
     79 """
     80 _handle_host_wandb_setting(host)
---> 81 if wandb.setup()._settings._noop:
     82     return True
     83 kwargs = dict(locals())

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in setup(settings)
    324 def setup(
    325     settings: Optional[Settings] = None,
    326 ) -> Optional["_WandbSetup"]:
--> 327     ret = _setup(settings=settings)
    328     return ret

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in _setup(settings, _reset)
    318     _WandbSetup._instance = None
    319     return None
--> 320 wl = _WandbSetup(settings=settings)
    321 return wl

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in _WandbSetup.__init__(self, settings)
    301     _WandbSetup._instance._update(settings=settings)
    302     return
--> 303 _WandbSetup._instance = _WandbSetup__WandbSetup(settings=settings, pid=pid)

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in _WandbSetup__WandbSetup.__init__(self, pid, settings, environ)
    111 wandb.termsetup(self._settings, logger)
    113 self._check()
--> 114 self._setup()
    116 tracelog_mode = self._settings._tracelog
    117 if tracelog_mode:

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in _WandbSetup__WandbSetup._setup(self)
    249 def _setup(self) -> None:
--> 250     self._setup_manager()
    252     sweep_path = self._settings.sweep_param_path
    253     if sweep_path:

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in _WandbSetup__WandbSetup._setup_manager(self)
    275 if self._settings._disable_service:
    276     return
--> 277 self._manager = wandb_manager._Manager(settings=self._settings)

File ~/.local/lib/python3.10/site-packages/wandb/sdk/, in _Manager.__init__(self, settings)
    137 token = _ManagerToken.from_environment()
    138 if not token:
--> 139     self._service.start()
    140     host = "localhost"
    141     transport = "tcp"

File ~/.local/lib/python3.10/site-packages/wandb/sdk/service/, in _Service.start(self)
    236 def start(self) -> None:
--> 237     self._launch_server()

File ~/.local/lib/python3.10/site-packages/wandb/sdk/service/, in _Service._launch_server(self)
    229     self._wait_for_ports(fname, proc=internal_proc)
    230 except Exception as e:
--> 231     _sentry.reraise(e)
    232 self._startup_debug_print("wait_ports_done")
    233 self._internal_proc = internal_proc

File ~/.local/lib/python3.10/site-packages/wandb/analytics/, in Sentry.reraise(self, exc)
    151 self.exception(exc)
    152 # this will messily add this "reraise" function to the stack trace,
    153 # but hopefully it's not too bad
--> 154 raise exc.with_traceback(sys.exc_info()[2])

File ~/.local/lib/python3.10/site-packages/wandb/sdk/service/, in _Service._launch_server(self)
    227 self._startup_debug_print("wait_ports")
    228 try:
--> 229     self._wait_for_ports(fname, proc=internal_proc)
    230 except Exception as e:
    231     _sentry.reraise(e)

File ~/.local/lib/python3.10/site-packages/wandb/sdk/service/, in _Service._wait_for_ports(self, fname, proc)
     92 if proc and proc.poll():
     93     # process finished
     94     # define these variables for sentry context grab:
     98     # proc_out =
     99     # proc_err =
    100     context = dict(
    101         command=proc.args,
    102         sys_executable=sys.executable,
    105 if proc.stderr else "",
    106     )
--> 107     raise ServiceStartProcessError(
    108         f"The wandb service process exited with {proc.returncode}. "
    109         "Ensure that `sys.executable` is a valid python interpreter. "
    110         "You can override it with the `_executable` setting "
    111         "or with the `WANDB__EXECUTABLE` environment variable.",
    112         context=context,
    113     )
    114 if not os.path.isfile(fname):
    115     time.sleep(0.2)

ServiceStartProcessError: The wandb service process exited with 1. Ensure that `sys.executable` is a valid python interpreter. You can override it with the `_executable` setting or with the `WANDB__EXECUTABLE` environment variable.

I am using wandb version 0.16.1. As you can see I am executing the code from within a jupyter notebook launched from a bazel server.

From this post it seems wandb can’t find a python interpreter in my environment. The output of print(sys.executable) is /private/var/tmp/_bazel_me/c6c153b8ee296ecf5ef55e689ef4faf0/execroot/bazel-out/darwin_arm64-fastbuild/jupyter.runfiles/python3_aarch64-apple-darwin/bin/python3 and the output of !python --version is Python 3.11.4.

The current click module is version 8.1.7 and upgrading it did not help nor did downgrading it to version 8.0.4.

Protobuf is showing as installed with version 3.20.3. Thanks very much for any insight you may have.

hey @ht99, have you tried setting WANDB__EXECUTABLE to your Python’s path? Additionally, do you reach this error when trying to login to wandb outside of a bazel server (and preferably in a fresh environment)? Would it also be possible to run !pip install protobuf explicitly before importing wandb and logging in?

Please let me know how any of the above suggestions go

Hi Hailey, since we have not heard back from you we are going to close this request. If you would like to re-open the conversation, please let us know!

Thanks for your suggestions @uma-wandb and sorry for the delay in response; I’ve just found time to debug this again. I’ve tried the following from within the bazel server:


I still get the same error message. I’ve also made sure that protobuf is installed explicitly.
I do not reach this error when logging into wandb outside of a bazel server in a conda env. Here are the differences in package versions between bazel and the working conda server:

Python version==3.10.9

Python version==3.11.7