-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Update install instructions for Bash and Zsh #1920
Conversation
@native-api thanks for creating a PR to try and tackle this. The Issue 🐛I feel that with all of this work on documenting exactly what to do for each shell, we're trying to solve the wrong problem; shell RC files are confusing, and not always consistent between shells and environments. All of the issues that have been raised about this have stemmed from the fact that New Init API 🔩I think that we should consider dropping the shell-specific approach entirely, and instead pyenv init --path and pyenv init --shell These are the two kinds of configuration that My rationale for dropping the per-shell documentation in I think this would be easier to deal with through a wiki entry. Old Init API 🕸️Of course, this means that things will change for users. I don't know what the policy for API change is for this project, but if we don't want to break Shell-Specific Help ℹ️I still think that the shell-specific information is useful, but perhaps it doesn't belong in the tool. If we repurpose cat <<- 'EOF'
Warning, `pyenv init -` will no longer work in future releases of pyenv.
To avoid breakages when this occurs, please move to the new configuration mechanism.
The old `pyenv init -` command has been split into two new commands:
`pyenv init --path` and `pyenv init --shell`.
You should remove the existing `pyenv init -` code, and instead
1. Add `pyenv init --path` to your `~/.profile` (or equivalent) file
2. Add `pyenv init --shell` to your `~/.bashrc` (or equivalent) file
In some cases you might find that this does not work. This is likely because shell configuration is hard!
Please visit .... for more information with shell-specific guidance.
EOF
source pyenv init --path
source pyenv init --shell What do you think? |
No offense, but reading all the replies in #1915 to my initial request, it looks a bit as the thread got "hijacked" for "all-things-shell-issues" ;-)
Nothing more; nothing about setting the Anyways: I removed everything pyenv related from my
So, I also added this before that line in
Actually, it looks like this did the trick! I can use pyenv and do no longer receive the WARNING when SSH'ing into it:
|
PS: I like @agoose77 's idea! Debugging the global RC-landscape is out of scope for pyenv; at least "core". Supporting all shells and advice on them seems to be more related to sidekick-projects like pyenv/pyenv-installer. |
This is wrong. You need to switch your installed Pyenv to it. This is why I gave the exact commands needed right at the top. |
I did by modifying the PATH to that new location - didn't I? |
Oh, sorry, I missed that part (I honestly thought that no-one would go for the trouble :-) ). Then it indeed should work. How exactly did you "clone #1920"? I suspect that you didn't check out the right branch and ended up at |
I'm wondering if I feel like the extra command to set the PATH is what's tripping people up as they think they need to replace the old command with that one. |
The idea is to make the configuration more future-proof. In the future, we may add/change steps in
I think that it's rather the fact that I failed to include the |
* Synchronize README.md with `pyenv init` * Add a Bash installation option (only to README) that would still allow automated install if ~/.profile sources ~/.bashrc * Add a ~/.bash_profile note * Concatenate shims activation into installation for brevity (Pyenv can't be used meaningfully without shims anyway) Otherwise, we'd need to duplicate all the ~/.profile shenanigans in both sections
@agoose77 This solution would work great for all of the use cases in my world! Just my 2 cents. |
Add guidance blocks Update Advanced Update OSX instructions Exclude Bash automated install Formatting and prrofreading
e504424
to
ea25bc2
Compare
@agoose77 @julianfortune @The-Judge
I think we can get the best of both worlds here if we include both an explanation of what the effect should be, and the ready-to-use examples for common setups.
This is exactly what the interface is now (just with keeping the the old name for "
I thought about renaming It's true that it'll make things marginally clearer. But the drawbacks are:
So my best idea for this -- if this is even worth doing, as per above -- is to introduce a new name as an alias to
The change was made to fix #1649. We needed to make a breaking change to force the users to change their configurations -- otherwise, they would keep falling victim to #1649 and would keep reporting it. And we needed to retain
Actually, |
eb6da03
to
fb4129d
Compare
@native-api thanks for the clarification. I agree on all points; I'm not pushing for any breaking changes any time soon. I like the |
The updated instructions seem pretty complete to me. The only issue I can see is for anyone using a shell framework like prezto or oh-my-zsh. They generally have some plugin for I imagine you don't need to go into detail about this, but maybe just a mention if you're using one of those frameworks you might only need the |
Thank you @aiguofer - even after following the changes mentioned, I was seeing issues. After seeing your comment on oh-my-zsh plugins I was able to resolve this by disabling the plugin. |
I feel that it's rather the responsibility of those projects to inform their users which configuration steps they're saving them from. |
Yeah that makes sense... Maybe just a mention to check how their framework handles |
WARNING was: ``` WARNING: `pyenv init -` no longer sets PATH. Run `pyenv init` to see the necessary changes to make to your configuration. ``` Refs. - pyenv/pyenv#1915 - pyenv/pyenv#1906 - pyenv/pyenv#1649 - pyenv/pyenv#1920 (comment)
pyenv init [<shell>]
to see text instructions for<shell>
:Make sure you have checked all steps below.
Prerequisite
pyenv init -
no longer sets PATH. #1915Description
Updated README and instructions for Bash and Zsh based on user feedback.
Going to ask for reviews before merging.
Tests