Command not found: daml

Hi, I am having an issue with running the code after I install it on my Mac. I have followed the instructions on the SDK documentation (1. installed dependencies, 2. installed the SDK, 3. added the daml bin to my path). However, when I run any daml command, it gives me the error that the command is not found. Can you please advise?

2 Likes

Hi Nicholas_Ho,

welcome to the DAML community and thanks for trying out DAML. :wave:

Most ways to add the daml binary to your path modify your profile or shell configuration. Thus, you might need to restart you shell for the changes to be picked up. If that doesn’t work, you might even need to log out and log in again.

If that doesn’t help, please let me know and I’ll try my best to be of further assistance.

Cheers,

Martin.

2 Likes

Hi Martin,

Thanks for the quick response! I’ve restarted multiple times but it still does not seem to work unfortunately.

Upon installing the SDK with the curl command, I received a message about adding a line of code to my ~/.zshrc before calling compinit. This is what I’m reading:

Please add /Users/nicholasho/.daml/bin to your PATH.
Bash completions installed for DAML assistant.
Zsh completions installed for DAML assistant.
To use them, add '~/.daml/zsh' to your $fpath, e.g. by adding the following
to the beginning of '~/.zshrc' before you call 'compinit':
fpath=(~/.daml/zsh $fpath)

I haven’t actually done this yet since it wasn’t in the instruction document. Is that something I should do? And how exactly would I got about doing it?

Thanks,
Nick

1 Like

For getting DAML in your path you can do the following depending on which shell you’re using.

To determine the shell you’re using you can run:

echo $0

It’ll tell you either ~bash or zsh, once you’ve figured that out run one of the sets of commands below

Bash:

echo "export PATH=$HOME/.daml/bin:$PATH" >> ~/.bash_profile
source ~/.bash_profile

Zsh:

echo "export PATH=$HOME/.daml/bin:$PATH" >> ~/.zshrc
echo "fpath=(~/.daml/zsh $fpath)" >> ~/.zshrc
source ~/.zshrc
1 Like

Thanks! Unfortunately I am still getting a “command not found: daml” error after doing all of that.

@Nicholas_Ho can you please run ls -l ~/.daml/bin/daml from your shell and tell us the output?

It should print the full path to the daml executable if the installation succeeded.

$ ls -l ~/.daml/bin/daml
lrwxrwxrwx 1 leos leos 22 Jul 28 17:39 /home/leos/.daml/bin/daml -> ../sdk/1.3.0/daml/daml*

2 Likes

If the executable is in place and you are still having issues with the PATH, keep in mind you can run daml command specifying the full path:

$ ~/.daml/bin/daml --help
Usage: daml COMMAND

Available options:
  -h,--help                Show this help text

Available commands:
  version                  Display DAML version information
  install                  Install the specified DAML SDK version
  uninstall                Uninstall the specified DAML SDK version
...
2 Likes