Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_alias_tips__preexec:34: command not found: python #60

Open
andig opened this issue Mar 17, 2022 · 5 comments
Open

_alias_tips__preexec:34: command not found: python #60

andig opened this issue Mar 17, 2022 · 5 comments

Comments

@andig
Copy link

andig commented Mar 17, 2022

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
@djui
Copy link
Owner

djui commented Mar 17, 2022

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.

@andig
Copy link
Author

andig commented Mar 17, 2022

I wouldn‘t know- not a regular python user. One option might be checking for python3 and then fall back to python?

@braggy
Copy link

braggy commented Apr 13, 2022

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)

@braggy
Copy link

braggy commented Apr 14, 2022

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.

@braggy
Copy link

braggy commented Apr 14, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants