mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Fix fish installation instructions (#1916)
This commit is contained in:
parent
fd3c891d76
commit
0d2fb35cee
2 changed files with 52 additions and 42 deletions
15
README.md
15
README.md
|
@ -216,12 +216,20 @@ easy to fork and contribute any changes back upstream.
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
- For **Fish shell**:
|
- For **Fish shell**:
|
||||||
|
|
||||||
|
Execute this interactively:
|
||||||
~~~ fish
|
~~~ fish
|
||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||||
set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||||
pyenv init --path | source
|
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
|
And add this to `~/.config/fish/config.fish`:
|
||||||
|
~~~ fish
|
||||||
|
status is-login; and pyenv init --path | source
|
||||||
|
~~~
|
||||||
|
|
||||||
|
If fish is not your login shell, also follow the bash/zsh instructions to add to ~/.profile.
|
||||||
|
|
||||||
- **Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy` too.
|
- **Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy` too.
|
||||||
|
|
||||||
3. **Add `pyenv init` to your shell** to enable shims and autocompletion.
|
3. **Add `pyenv init` to your shell** to enable shims and autocompletion.
|
||||||
|
@ -239,8 +247,9 @@ easy to fork and contribute any changes back upstream.
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
- For **Fish shell**:
|
- For **Fish shell**:
|
||||||
|
Add this to `~/.config/fish/config.fish`:
|
||||||
~~~ fish
|
~~~ fish
|
||||||
echo -e '\n\n# pyenv init\nif command -v pyenv 1>/dev/null 2>&1\n pyenv init - | source\nend' >> ~/.config/fish/config.fish
|
pyenv init - | source
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
**General warning**: There are some systems where the `BASH_ENV` variable is configured
|
**General warning**: There are some systems where the `BASH_ENV` variable is configured
|
||||||
|
|
|
@ -83,50 +83,49 @@ function help_() {
|
||||||
ksh )
|
ksh )
|
||||||
profile='~/.profile'
|
profile='~/.profile'
|
||||||
;;
|
;;
|
||||||
fish )
|
|
||||||
profile='~/.config/fish/config.fish'
|
|
||||||
;;
|
|
||||||
* )
|
* )
|
||||||
profile='your profile'
|
profile='your profile'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
{ echo "# Add pyenv executable to PATH by adding"
|
{
|
||||||
echo "# the following to ~/.profile:"
|
|
||||||
echo
|
|
||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
|
echo "# Add pyenv executable to PATH by running"
|
||||||
|
echo "# the following interactively:"
|
||||||
|
echo
|
||||||
echo 'set -Ux PYENV_ROOT $HOME/.pyenv'
|
echo 'set -Ux PYENV_ROOT $HOME/.pyenv'
|
||||||
echo 'set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths'
|
echo 'set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths'
|
||||||
;;
|
echo
|
||||||
* )
|
echo "# Load pyenv automatically by appending"
|
||||||
|
echo "# the following to ~/.config/fish/config.fish:"
|
||||||
|
echo
|
||||||
|
echo 'status is-login; and pyenv init --path | source'
|
||||||
|
echo 'pyenv init - | source'
|
||||||
|
echo
|
||||||
|
echo "# If fish is not your login shell,"
|
||||||
|
echo "# add the following to ~/.profile:"
|
||||||
|
echo
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
||||||
echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
|
echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
|
||||||
|
echo 'eval "$(pyenv init --path)"'
|
||||||
|
echo
|
||||||
;;
|
;;
|
||||||
esac
|
* )
|
||||||
|
echo "# Add pyenv executable to PATH by adding"
|
||||||
|
echo "# the following to ~/.profile:"
|
||||||
|
echo
|
||||||
|
echo 'export PYENV_ROOT="$HOME/.pyenv"'
|
||||||
|
echo 'export PATH="$PYENV_ROOT/bin:$PATH"'
|
||||||
echo
|
echo
|
||||||
echo "# Load pyenv automatically by appending"
|
echo "# Load pyenv automatically by appending"
|
||||||
echo "# the following to ${profile}:"
|
echo "# the following to ${profile}:"
|
||||||
echo
|
echo
|
||||||
case "$shell" in
|
|
||||||
fish )
|
|
||||||
echo 'pyenv init - | source'
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
echo 'eval "$(pyenv init -)"'
|
echo 'eval "$(pyenv init -)"'
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo
|
echo
|
||||||
echo "# and the following to ~/.profile:"
|
echo "# and the following to ~/.profile:"
|
||||||
echo
|
echo
|
||||||
case "$shell" in
|
|
||||||
fish )
|
|
||||||
echo 'pyenv init --path | source'
|
|
||||||
;;
|
|
||||||
* )
|
|
||||||
echo 'eval "$(pyenv init --path)"'
|
echo 'eval "$(pyenv init --path)"'
|
||||||
;;
|
|
||||||
esac
|
|
||||||
echo
|
echo
|
||||||
echo '# If your ~/.profile sources '"${profile}"','
|
echo '# If your ~/.profile sources '"${profile}"','
|
||||||
echo '# the lines should be inserted before the part'
|
echo '# the lines should be inserted before the part'
|
||||||
|
@ -135,6 +134,8 @@ function help_() {
|
||||||
echo '# Make sure to restart your entire logon session'
|
echo '# Make sure to restart your entire logon session'
|
||||||
echo '# for changes to ~/.profile to take effect.'
|
echo '# for changes to ~/.profile to take effect.'
|
||||||
echo
|
echo
|
||||||
|
;;
|
||||||
|
esac
|
||||||
} >&2
|
} >&2
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue