1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-18 00:03:45 -05:00

Separate startup logic into PATH and the rest

PATH manipulation should be done in ~/.profile rather than ~/.*rc since .rc can be sourced multiple times
This commit is contained in:
Ivan Pozdeev
2021-05-04 04:30:52 +03:00
parent b0b862ca64
commit 7838707595
3 changed files with 42 additions and 34 deletions

View File

@@ -208,28 +208,18 @@ easy to fork and contribute any changes back upstream.
pyenv repo is cloned and add `$PYENV_ROOT/bin` to your `$PATH` for access
to the `pyenv` command-line utility.
- For **bash**:
- For **bash**/**Zsh**:
~~~ bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bash_profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bash_profile
~~~
- For **Ubuntu Desktop**:
~~~ bash
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc
~~~
- For **Zsh**:
~~~ zsh
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.profile
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.profile
echo 'eval "$(pyenv init --path)"' >> ~/.profile
~~~
- For **Fish shell**:
~~~ fish
set -Ux PYENV_ROOT $HOME/.pyenv
set -Ux fish_user_paths $PYENV_ROOT/bin $fish_user_paths
pyenv init --path | source
~~~
- **Proxy note**: If you use a proxy, export `http_proxy` and `https_proxy` too.
@@ -239,11 +229,6 @@ easy to fork and contribute any changes back upstream.
configuration file since it manipulates `PATH` during the initialization.
- For **bash**:
~~~ bash
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
~~~
- For **Ubuntu Desktop** and **Fedora**:
~~~ bash
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bashrc
~~~