_alias_tips__preexec:34: command not found: python
Recently getting this message on OSX:
~/htdocs
❯ which python
_alias_tips__preexec:34: command not found: python
python not found
~/htdocs
❯ which python3
_alias_tips__preexec:34: command not found: python
/opt/homebrew/bin/python3
Thanks @andig for reporting. The python version is currently hardcoded to python3.
Do you have an idea how to best route to Python 3 via python or python3? I know that some distributions have defaulted to have python actually be Python 3, yet I am not aware of a good heuristic to figure that out.
I wouldn‘t know- not a regular python user. One option might be checking for python3 and then fall back to python?
I've just started getting this issue and I believe it started right after I typo'd with 'd <dir_name>' instead of 'cd <dir_name>'. It's done it ever since (new iTerm2 sessions and a reboot)
OK, so I've found the d function in ~/.oh-my-zsh/lib/directories.zsh:
function d () {
if [[ -n $1 ]]; then
dirs "$@"
else
dirs -v | head -n 10
fi
}
compdef _dirs d
After giving the command dirs ~, this problem is now fixed for me!
Strangely, I can't seem to replicate the issue again with d <dir_name> though.
It turns out the fix was also to have a symlink for python to python3, going by @djui's previous comment. It's now reproducable:
$ ll /usr/local/bin/python
/usr/local/bin/python -> /usr/local/bin/python3
$ rm /usr/local/bin/python
remove /usr/local/bin/python? y
$ d test
_alias_tips__preexec:34: command not found: python
$ ln -s /usr/local/bin/python3 /usr/local/bin/python
_alias_tips__preexec:34: command not found: python
$ d test
$ d test