Trouble Launching Jupyter Notebook on macOS: dirname and jupyter-notebook Not Found

Hello everyone,

I’m experiencing issues when trying to launch Jupyter Notebook on my macOS system through Anaconda. When I attempt to start it, I get the following error messages:

bash

__add_sys_prefix_to_path:6: command not found: dirname
__add_sys_prefix_to_path:7: command not found: dirname
/Users/m/opt/anaconda3/bin/jupyter_mac.command: line 1: dirname: command not found
/Users/m/opt/anaconda3/bin/jupyter_mac.command: line 3: /jupyter-notebook: No such file or directory

I’ve tried the following troubleshooting steps:

  1. Checked if dirname is available in the shell (it’s not).
  2. Checked my PATH variable (echo $PATH), and it seems to be okay.
  3. Attempted to manually start Jupyter Notebook using jupyter notebook in the terminal, but faced the same issues.

I’m using Anaconda3, and my operating system is Mac OS13.5.2 (22G91).

Has anyone encountered this issue before, and if so, how did you resolve it? Any help would be greatly appreciated.

Thank you!