You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make sure no duplicated issue has already been reported in the pyenv issues. You should look for closed issues, too.
Make sure you are not asking us to help solving your specific issue.
GitHub issues is opened mainly for development purposes. If you want to ask someone to help solving your problem, go to some community site like Gitter, StackOverflow, etc.
Make sure your problem is not derived from packaging (e.g. Homebrew).
Please refer to the package documentation for the installation issues, etc.
Make sure your problem is not derived from plugins.
This repository is maintaining pyenv and the default python-build plugin only. Please refrain from reporting issues of other plugins here.
Description
Platform information (e.g. Ubuntu Linux 16.04): Debian Buster, same should apply to most if not all popular distros
This is what is currently shown after running pyenv-installer (most of this message is coming from output of pyenv init so this repo should be appropriate):
WARNING: seems you still have not added 'pyenv' to the load path.
# Add pyenv executable to PATH by adding
# the following to ~/.profile:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
# Load pyenv automatically by appending
# the following to ~/.bashrc:
eval "$(pyenv init -)"
# and the following to ~/.profile:
eval "$(pyenv init --path)"
# Make sure to restart your entire logon session
# for changes to ~/.profile to take effect.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
So by following this, I end up with these contents appended to the end of the listed files:
This will result in the new bash shells giving this output on startup of interactive login shell (meaning that the commands from .bashrc failed to run):
-bash: pyenv: command not found
-bash: pyenv: command not found
This is because in the default contents of ~/.profile (in case of Debian-based distros), ~/.bash_profile (in case of RHEL-based distros), or /etc/profile (in case of openSUSE) file, ~/.bashrc is sourced at the beginning of it and so when user appends these commands at the end, it doesn't work because .bashrc pretty much always runs before.profile.
Additional context
pyenv/pyenv-virtualenv#383 and #1909 address somewhat similar issues but neither of the bug fixes are fixing what I'm reporting in this issue.
The text was updated successfully, but these errors were encountered:
This can only be seen in text sessions -- so I couldn't see it in a GUI session.
(Of course, the errors messages still happen -- but they are hidden from the user and do not affect interactive shells run in windows, even if they are login shells.)
So, all we need to do is move the code in ~/.profile to before the chunk that sources ~/.bashrc. @jack1142 , could you check if that fixes the problem?
I've checked that we cannot just move all the code to ~/.bashrc and detect a login shell -- OSX ~/.profile does not source it (neither it, nor ~/.zshrc).
I am going to add a note here in case anyone stumbled upon the same issue like mine.
I had the same error like in OP and it took me a while to figure it out.
bash: pyenv: command not found
I was installing pyenv using pyenv-installer on my Arch Linux Desktop. Upon reading the last step where I need to paste mentioned lines into ~/.profile, I found out that I don't have the file in my $HOME. So I created one. It wouldn't work at all, but sourcing the file worked.
So after digging, I found this. Turned out if you have ~/.bash_profile or ~/.bash_login, bash wouldn't load ~/.profile. I pasted required lines into ~/.bash_profile instead, restarted my session, and it is finally working.
Some distros might auto load ~/.profile, but in my Arch, it didn't.
Prerequisite
pyenv
and the defaultpython-build
plugin only. Please refrain from reporting issues of other plugins here.Description
This is what is currently shown after running
pyenv-installer
(most of this message is coming from output ofpyenv init
so this repo should be appropriate):So by following this, I end up with these contents appended to the end of the listed files:
~/.profile
~/.bashrc
This will result in the new bash shells giving this output on startup of interactive login shell (meaning that the commands from
.bashrc
failed to run):This is because in the default contents of
~/.profile
(in case of Debian-based distros),~/.bash_profile
(in case of RHEL-based distros), or/etc/profile
(in case of openSUSE) file,~/.bashrc
is sourced at the beginning of it and so when user appends these commands at the end, it doesn't work because.bashrc
pretty much always runs before.profile
.Additional context
pyenv/pyenv-virtualenv#383 and #1909 address somewhat similar issues but neither of the bug fixes are fixing what I'm reporting in this issue.
The text was updated successfully, but these errors were encountered: