(formatting fixes after merge)
[no ci]
This commit is contained in:
parent
5e4b2ac26c
commit
3cd07fbabb
42
README.md
42
README.md
@ -180,31 +180,31 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
|||||||
#### Bash
|
#### Bash
|
||||||
<details>
|
<details>
|
||||||
|
|
||||||
Stock Bash startup files vary widely between distributions in which of them source
|
Stock Bash startup files vary widely between distributions in which of them source
|
||||||
which, under what circumstances, in what order and what additional configuration they perform.
|
which, under what circumstances, in what order and what additional configuration they perform.
|
||||||
As such, the most reliable way to get Pyenv in all environments is to append Pyenv
|
As such, the most reliable way to get Pyenv in all environments is to append Pyenv
|
||||||
configuration commands to both `.bashrc` (for interactive shells)
|
configuration commands to both `.bashrc` (for interactive shells)
|
||||||
and the profile file that Bash would use (for login shells).
|
and the profile file that Bash would use (for login shells).
|
||||||
|
|
||||||
1. First, add the commands to `~/.bashrc` by running the following in your terminal:
|
1. First, add the commands to `~/.bashrc` by running the following in your terminal:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
|
||||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
|
||||||
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
|
echo 'eval "$(pyenv init - bash)"' >> ~/.bashrc
|
||||||
```
|
```
|
||||||
2. Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
2. Then, if you have `~/.profile`, `~/.bash_profile` or `~/.bash_login`, add the commands there as well.
|
||||||
If you have none of these, create a `~/.profile` and add the commands there.
|
If you have none of these, create a `~/.profile` and add the commands there.
|
||||||
|
|
||||||
* to add to `~/.profile`:
|
* to add to `~/.profile`:
|
||||||
``` bash
|
``` bash
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
|
||||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
|
||||||
echo 'eval "$(pyenv init - bash)"' >> ~/.profile
|
echo 'eval "$(pyenv init - bash)"' >> ~/.profile
|
||||||
```
|
```
|
||||||
* to add to `~/.bash_profile`:
|
* to add to `~/.bash_profile`:
|
||||||
```bash
|
```bash
|
||||||
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
|
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
|
||||||
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
|
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
|
||||||
echo 'eval "$(pyenv init - bash)"' >> ~/.bash_profile
|
echo 'eval "$(pyenv init - bash)"' >> ~/.bash_profile
|
||||||
```
|
```
|
||||||
@ -227,7 +227,7 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
|||||||
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
|
echo 'eval "$(pyenv init - zsh)"' >> ~/.zshrc
|
||||||
```
|
```
|
||||||
|
|
||||||
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
|
If you wish to get Pyenv in noninteractive login shells as well, also add the commands to `~/.zprofile` or `~/.zlogin`.
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
#### Fish
|
#### Fish
|
||||||
@ -235,21 +235,21 @@ See [Advanced configuration](#advanced-configuration) for details and more confi
|
|||||||
<details>
|
<details>
|
||||||
|
|
||||||
1. If you have Fish 3.2.0 or newer, execute this interactively:
|
1. If you have Fish 3.2.0 or newer, execute this interactively:
|
||||||
~~~ fish
|
```fish
|
||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||||
test -d $PYENV_ROOT/bin; and fish_add_path $PYENV_ROOT/bin
|
test -d $PYENV_ROOT/bin; and fish_add_path $PYENV_ROOT/bin
|
||||||
~~~
|
```
|
||||||
|
|
||||||
2. Otherwise, execute the snippet below:
|
2. Otherwise, execute the snippet below:
|
||||||
~~~ fish
|
```fish
|
||||||
set -Ux PYENV_ROOT $HOME/.pyenv
|
set -Ux PYENV_ROOT $HOME/.pyenv
|
||||||
test -d $PYENV_ROOT/bin; and set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
test -d $PYENV_ROOT/bin; and set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
|
||||||
~~~
|
```
|
||||||
|
|
||||||
3. Now, add this to `~/.config/fish/config.fish`:
|
3. Now, add this to `~/.config/fish/config.fish`:
|
||||||
~~~ fish
|
```fish
|
||||||
pyenv init - fish | source
|
pyenv init - fish | source
|
||||||
~~~
|
```
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
### C. Restart your shell
|
### C. Restart your shell
|
||||||
|
Loading…
x
Reference in New Issue
Block a user