Unable to Install Daml SDK
- CameronScarpatiOP
I am attempting to install the Daml SDK, but I am having trouble. I managed to successfully run the following command it didn’t have any errors.
curl -sSL https://get.daml.com/ | sh
However, when trying to run daml version, it says that daml command doesn’t exist. Then, I went through the following steps labeled in the screenshot (including opening a new terminal each time), but the daml command is still unable to be used.
Any help is appreciated. I’m running on a Mac (zsh).
- WallaceKelly
On a previous thread, it was suggested to try…
ls -l ~/.daml/bin/daml… and let us know what you see.
Mine looks like this:
lrwxr-xr-x 1 wallacekelly 22 Apr 23 08:41 /Users/wallacekelly/.daml/bin/daml -> ../sdk/2.8.3/daml/daml - CameronScarpati
I get the following.
lrwxr-xr-x 1 stevenscarpati staff 22 Apr 22 20:33 /Users/stevenscarpati/.daml/bin/daml → …/sdk/2.8.4/daml/daml
The largest differences that I notice is that the version I have is 2.8.4. Maybe there is something to do with the staff keyword after stevenscarpati, but I frankly have no clue.
- Ben_M
STAFFis the Group that normal users are added to on a MacOS by default, nothing more.Here is the same command output from my system:
# Daml benm:bash $ ls -l ~/.daml/bin/daml lrwxr-xr-x@ 1 benm staff 22 23 Feb 12:08 /Users/benm/.daml/bin/daml -> ../sdk/2.8.3/daml/daml # Groups benm:bash $ groups staff everyone localaccounts _appserverusr _appserveradm com.apple.access_ssh com.apple.sharepoint.group.2 _lpoperator com.apple.sharepoint.group.1It seems that you have a correct install, so you can do:
$ daml version $ daml --helpFrom there, just follow the Getting Started with Daml documentation.
- CameronScarpati
- WallaceKelly
I suppose this just means your
PATHwas not updated correctly.I have the
./daml/bin/folder in my path.> echo "${PATH}" | tr ':' '\n' | grep daml/Users/wallacekelly/.daml/bin - Gary_Verhaegen
@CameronScarpati To build up on @WallaceKelly’s message, can you please share the output of this command?
echo "${PATH}" | tr ':' '\n' | grep damlas well as this command:
cat $HOME/.zprofile | grep 'daml/bin'Ideally, your session should look something like this:
$ echo "${PATH}" | tr ':' '\n' | grep daml /Users/stevenscarpati/.daml/bin $ cat $HOME/.zprofile | grep 'daml/bin' export PATH="$HOME/.daml/bin:$PATH" $If you’re seeing different output, please share what you get instead of the above.
- CameronScarpati
I get the following message in my terminal. I have no idea why I don’t get a message for the first command, but the second command is definitely due to the fact that I’ve put these commands in so many times. I even reinstalled daml using the command listed below.
curl -sSL https://get.daml.com/ | shAny help is appreciated. Below is my session after those two commands.
- Gary_Verhaegen 1
That
command not found: compdefline near the top may be the cause of the issue here. A possible hypothesis is that your.zprofiledoes contain the appropriate entry to adddamltoPATH, but does not reach that line because of an earlier failure.The easiest way to move forward here would be for you to post your entire
~/.zprofile. However, this may be a bad idea. In some situations, passwords and other credentials need to be defined as environment variables, and sometimes they can end up into your~/.zprofile.Could you look through your
~/.zprofilevery carefully to verify that it does not contain any credentials or passwords, and, assuming it doesn’t, post the entire thing here?If you don’t know how to access your
~/.zprofileoutside of the terminal, you can show the entire file in a terminal by running$ cat ~/.zprofileIf you’re not comfortable posting you
~/.zprofile, I’d suggest following these steps. First, try runningecho $SHELLin your terminal, to make sure you are indeed runningzsh. Then, open your~/.zprofileand addecho Hello!at the top. Open a new terminal and check that you seeHello!at the top, before the first prompt. Then, addecho Bye!at the end of the file. Open a new terminal and verify that you can see bothHello!andBye!before your prompt.If you see both, it means the entire file runs to completion, and the issue must be more involved. If you don’t see the
Bye!message, try moving theecho Bye!command up in the~/.zprofileone line at a time, until it appears (saving the file and opening a new terminal each time). When it appears, you know the line you just crossed is the one causing an issue.If both messages appear right away, then I’d try adding our first command,
echo "${PATH}" | tr ':' '\n' | grep daml, at the end of your~/.zprofile, right before theecho Bye!. If you see nothing in-betweenHello!andBye!, then I’m out of ideas without seeing your~/.zprofile. If you see the expected/Users/stevenscarpati/.daml/binin-between the two, it means that~/.zprofilesets yourPATHas expected, but something else resets it afterwards.If you never see the
Hello!message, it means yourzshis somehow not sourcing~/.zprofileat all and we should set thePATHelsewhere.In all cases, the output of
which zshandzsh --versioncould be useful too in debugging this. - CameronScarpati
- CameronScarpati
I also tried reinstalling zsh using homebrew, but nothing has seemed to get rid of that unknown command compdef.
- Gary_Verhaegen
There is indeed nothing there that should cause an issue. I’m left with the idea that something else must be resetting the
PATHafterwards, then.You can double-check that by running:
$ echo 'echo "${PATH}" | tr ":" "\n" | grep daml' >> ~/.zprofileGiven your current
.zprofile, it should print out something like:/Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/bin /Users/stevenscarpati/.daml/binat the top of the next terminal you open.
One other file that
zshloads, I believe, after~/.zprofile, is~/.zshrc. Maybe you have something that resets your path there? (and possibly tries to usecompdef)Can you look at and then, if safe, share the output of
$ cat ~/.zshrcplease?
- CameronScarpati
- Gary_Verhaegen
Ok, so it looks lik it’s
brew’s fault?
They did something weird there, likely some escaping issue.Do you see this line in your
.zshrc?export PATH=/opt/homebrew/bin:...The problem with that line is that it sets the PATH to an exact value, ignoring any previous value the PATH may have had.
Usually, PATH updates are meant to keep the previous PATH and add to it, either at the beginning or at the end, so they generally look something like:
export PATH="/some/new/entry:$PATH"so that the old PATH is preserved (here we add something to the front).
That line was probably meant to be
export PATH="/opt/homebrew/bin:$PATH"but something went wrong and the current value of PATH at the time of updating the
.zshrcfile was expanded. Chronologically, that would have happened before you installed Angular, so it may be a while ago.At some point you’ll probably want to clean up both your
.zprofileand your.zshrc, but the shortest path to having things work right now is to do$ echo 'export PATH="$HOME/.daml/bin:$PATH"' >> ~/.zshrcNotice the
.zshrcinstead of.zprofile. - Gary_Verhaegen 1
If you want to do said clean-up, first, make a backup of your current files, in case I made a silly typo in the following that will break everything:
$ cp ~/.zshrc ~/Desktop/zshrc_backup $ cp ~/.zprofile ~/Desktop/zprofile_backupThen, you can type:
$ open -a TextEdit $HOME/.zshrcin a Terminal, which will open your
~/.zshrcin the TextEdit graphical application. You can then replace all of its contents with the following:# >>> conda initialize >>> # !! Contents within this block are managed by 'conda init' !! __conda_setup="$('/Users/stevenscarpati/opt/anaconda3/bin/conda' 'shell.zsh' 'hook' 2>/dev/null)" if [ $? -eq 0 ]; then eval "$__conda_setup" else if [ -f "/Users/stevenscarpati/opt/anaconda3/etc/profile.d/conda.sh" ]; then . "/Users/stevenscarpati/opt/anaconda3/etc/profile.d/conda.sh" else export PATH="/Users/stevenscarpati/opt/anaconda3/bin:$PATH" fi fi unset __conda_setup # <<< conda initialize <<< export PATH="/opt/homebrew/bin:$PATH" # possible fix for command not found; compdef autoload -Uz compinit && compinit # Load Angular CLI autocompletion source <(ng completion script) # old zprofile export PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:$PATH" export JAVA_HOME="$(/usr/libexec/java_home)" export PATH="$HOME/.daml/bin:$PATH"Note that, barring me typoing, the file should be unchanged until the
<<< conda initialize <<<line.The
compdef: command not foundmessage likely comes from the Angular completion attempt with the line:source <(ng completion script)The easiest way to remove the warning is to comment out (or remove) that line. If you want to try to make it work, though, there is a Stack Overflow question about exactly that case, which seems to suggest a fix (which I’ve included above).
Once you’ve copied the above into your
~/.zshrc, it includes everything you currently have in your ~/.zprofile` so you can remove that one with$ rm ~/.zprofileHope that helps.
- CameronScarpati 1
Gary_Verhaegen:,
This seems to work. Thanks for all the help!





