admin管理员组文章数量:1128307
I'm trying to find out what the path of the micromamba
executable is that is used when I invoke micromamba
in my zsh
shell (so that I can upgrade the executable as I'm using v2.0.2 instead of the latest).
I've tried which micromamba
but that just returns an unhelpful zsh
function and not the actual executable path:
$ which micromamba
micromamba () {
__mamba_wrap "${@}"
}
How can I find the actual location, similar to the way which python
returns /Users/home/micromamba/envs/py13/bin/python
?
I'm trying to find out what the path of the micromamba
executable is that is used when I invoke micromamba
in my zsh
shell (so that I can upgrade the executable as I'm using v2.0.2 instead of the latest).
I've tried which micromamba
but that just returns an unhelpful zsh
function and not the actual executable path:
$ which micromamba
micromamba () {
__mamba_wrap "${@}"
}
How can I find the actual location, similar to the way which python
returns /Users/home/micromamba/envs/py13/bin/python
?
1 Answer
Reset to default 1I found 4 ways of doing this, varying in generality:
Check the help text
It turns out, the executable's location is part of the default help message, on the line with "Usage":
$ micromamba
Version: 2.0.5
Usage: /Users/home/.local/bin/micromamba [OPTIONS] [SUBCOMMAND]
Options:
-h,--help Print this help message and exit
...
Inspect shell function
The micromamba
shell function calls __mamba_wrap
, so let's which
that:
$ which __mamba_wrap
__mamba_wrap () {
\local cmd="${1-__missing__}"
case "${cmd}" in
(activate | reactivate | deactivate) __mamba_xctivate "${@}" ;;
(install | update | upgrade | remove | uninstall) __mamba_exe "${@}" || \return
__mamba_xctivate reactivate ;;
(self-update) __mamba_exe "${@}" || \return
if [ -f "/Users/home/.local/bin/micromamba.bkup" ]
then
rm -f "/Users/home/.local/bin/micromamba.bkup"
fi ;;
(*) __mamba_exe "${@}" ;;
esac
}
This strongly suggests /Users/home/.local/bin/micromamba
, but to confirm let's do:
$ which __mamba_exe
__mamba_exe () {
(
"/Users/home/.local/bin/micromamba" "${@}"
)
}
Use which -a
which -a
suggests the same path with less typing:
$ which -a micromamba
micromamba () {
__mamba_wrap "${@}"
}
/Users/home/.local/bin/micromamba
Check manually in directories on $PATH
This one-liner does essentially the same as which -a
(if I understand correctly what which -a
does:
$ echo $PATH | tr ':' '\n' | xargs -I {} find {} -name micromamba 2>/dev/null
/Users/home/.local/bin/micromamba
本文标签: condaHow to I find out the real location of the micromamba executable binaryStack Overflow
版权声明:本文标题:conda - How to I find out the real location of the micromamba executable binary - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736719638a1949395.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
which __mamba_wrap
? – robertklep Commented Jan 8 at 14:11micromamba
invokes the command__mamba_wrap
, so this would be the next piece to hunt for. Maybe it is the binary you are looking for, maybe it is another function. – user1934428 Commented Jan 8 at 15:52command -v micromamba
? – Fravadona Commented Jan 8 at 17:01which -am '*mamba*'
may be useful. The-m
parameter allows a pattern; this will show the executables / functions / aliases / etc that are available withmamba
in the name. – Gairfowl Commented Jan 8 at 17:18$ command -v micromamba
outputsmicromamba
– Cornelius Roemer Commented Jan 8 at 17:33