zsh-quickstart-kit
zsh-quickstart-kit copied to clipboard
(anon):16: command not found: python
Describe the bug After installing MacOS 12.3 Monterey I get the error every time I boot a fresh terminal session. Running on a MacBook Pro M1.
(anon):16: command not found: python
Expected behavior No errors
Additional context This only started since updating the OS to 12.3. I have Pyenv Python installed.
I have eval "$(pyenv init --path)"
in my 001-config file which evaluates the keyword python after my session has booted, but the error appears before this command is presumably initiated.
I have tried running zqs update
with no luck.
I'm on 12.3 but not seeing this yet. I have python3 installed via brew
, though. I'll take a look but realistically not until the weekend
Problem seems to be at ohmyzsh python plugin
https://github.com/ohmyzsh/ohmyzsh/issues/10469
Thanks for tracking this down, @realsuiciniv
Given that this is an upstream problem I'm not sure what I can do to fix it other than remove the python plugin from the default list when python
isn't found in the user's $PATH
.
That seems problematic though - either they silently lose functionality they're used to using, or the quickstart starts spamming them with a warning every time they open a new terminal window.
@RonanJackson, @realsuiciniv - which do you think is the least annoying workaround?
I could hack something that looks for a sentinel file and only spams if the sentinel is missing, but I don't want to pollute users' home directories more than I already am.
I'm confused why my Intel machine doesn't seem to have this issue but my M1 does, is this related?
What do you think of checking for python
, and if it's not in $PATH
, aliasing it to python3
if python3
is in $PATH
?
And thanks for the find, @realsuiciniv.
I'm a little hesitant to step on people's environments like that by default. Maybe have it puke up a warning, and add a zqs
command to enable setting the alias.
i solved this on my system using
sudo apt install -y python-is-python3
i solved this on my system using
sudo apt install -y python-is-python3
This is a Mac specific issue, not Ubuntu/Debian.
I've tried 'alias python=/usr/bin/python3' in .zshrc.d, but the plugins are loaded before so it doesn't seem to help.
is there a place to set alias before .zshrc is loaded? Adding to .zshenv also doesn't work.
I'll make a .zshrc.preplugins.d
.
@defcon79 / @RonanJackson, would you mind testing the add-zshrc.pre-plugins.d-handling
branch and see if that allows you to work around the issue?
I don't see this branch, looks like you deleted after merging to main. Doesn't seem to have fixed anything when I updated zsh from the main branch. Anything you would like me to try?
@unixorn I have tested zshrc.pre-plugins.d
, and creating file with something like this
export PATH="/usr/local/opt/[email protected]/bin:/usr/local/opt/[email protected]/libexec/bin:$PATH"
solves the issue.
I'm still seeing this issue while using the above suggestions. I'm on Monterey 12.4. Using python3 from brew.
In this directory (~/.zshrc.pre-plugins.d) I created a file call 001-update-python
Put this entry: export PATH="/usr/local/Cellar/[email protected]/3.9.13_1/bin:$PATH"
Python executes correctly but I still get the error.
(anon):16: command not found: python (anon):16: command not found: python (anon):16: command not found: python
In this directory (~/.zshrc.pre-plugins.d) I created a file call 001-update-python Remove numbers from the beginning. Should fix the issue.
@jmcdowell, @kpostekk, @realsuiciniv, @RonanJackson, @defcon79
#220 should fix things - if you still have issues, we can re-open this.
I will test it soon
I'm still running into this issue after #220 - the error is occurring during the loading of the zsh-completion-generator plugin
That's weird - zsh-completion-generator is only supposed to load when you explicity use it.
What does which python
show on your machine? And please paste the error message you're seeing.
If you set GENCOMPL_PY=python3
in a file in ~/.zshrc.pre-plugins.d
do you still see the error?
The error is the same as mentioned in this ticket
Creating a zgenom save
(anon):16: command not found: python
(anon):16: command not found: python
What does which python show on your machine?
The alias you added in #220 is getting set
which python
python: aliased to python3
If you set GENCOMPL_PY=python3 in a file in ~/.zshrc.pre-plugins.d do you still see the error?
This fixes the error!
Thanks!
I'll add a workaround that sets GENCOMPL_PY
if it's unset and python
is not in $PATH
, then unsets it after loading all the plugins.
@fwwieffering - could you please comment out your GENCOMPL_PY
setter, then zqs selfupdate
and confirm this fixed it for you?
Hopefully #223 fixed the zsh-completions-plugin special case.
Thanks!
@unixorn everything is hunky dory. Thanks for the fix!
Thanks for checking, I appreciate it.
Everything seems to work for me now, thanks!