Hi, I tried to install python3 and got the following
~/projects/rust/ockam on develop
± flox install -e ockam python3 ockam
~/projects/rust/ockam on develop
± flox list -e ockam ockam
etorreborre/ockam
Alias ockam
System x86_64-darwin
Path /Users/etorreborre/.local/share/flox/environments/etorreborre/ockam
Curr Gen 2
Packages
0 stable.etorreborre.ockam.0_77_0
1 stable.nixpkgs-flox.python3
~/projects/rust/ockam on develop
± which python ockam
/Users/etorreborre/.local/share/flox/environments/etorreborre/ockam/bin/python
~/projects/rust/ockam on develop
± python --version ockam
Python 2.7.16
Python being listed as stable.nixpkgs-flox.python3 then returning 2.7.16 is really weird. But, not being a python developer, I might be missing a subtlety.
Hi @etorreborre - if I’m not mistaken, @mkenigs append confirms you need to use hash -r with zsh. I’m unclear if we can add it to the flox install command if it only happens with zsh, but I’ll put it on the list to have a look. In the meantime though I believe you have this workaround; if this is not the case, please do let me know.
Hi Robin, yes the workaround works for now. I think it could really make sense to integrate it to any activation:
because when you don’t know about it, it is really not obvious that hash -r could be the solution (I didn’t know that zsh behaved this way)
even if you know it, you might forget to do it and be puzzled until you remember
even if you know it and remember about it, this is one more step that you have to manually do, “just in case”, instead of just activating an environment and forgetting about this issue
The problem is hash -r is a shell builtin, so if we run it in flox, it won’t affect the calling shell. So I think the best thing we could do is document hash -r or try to detect when running it is necessary and print please run "hash -r"
Yeah or alternatively set +o hashall. We could also add that into the script that flox activate prints (since that’s getting sourced), but that feels a bit invasive to me