mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 17:02:32 -05:00
Address common issues with load path configuration in docs (#5356)
* Add instructions on how to add pyenv to load path * Support zsh in pyenv load path instructions * Make instructions for Mac work when shell-specific profile file exists * Includes are weird... * . * Fix my misunderstanding of what files zsh sources * Operator precedence, or something like that
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
To install/update pyenv, run the following command:
|
||||||
|
|
||||||
|
.. prompt:: bash
|
||||||
|
|
||||||
|
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
||||||
|
|
||||||
|
After this command, you will see a warning about 'pyenv' not being in the load path. To address this,
|
||||||
|
you should run these commands:
|
||||||
|
|
||||||
|
.. prompt:: bash
|
||||||
|
|
||||||
|
profile=$([ -n "$ZSH_VERSION" ] && echo ~/.zprofile || ([ -f ~/.bash_profile ] && echo ~/.bash_profile || echo ~/.profile))
|
||||||
|
rcfile=$([ -n "$ZSH_VERSION" ] && echo ~/.zshrc || echo ~/.bashrc)
|
||||||
|
printf '%s\n%s\n%s\n' 'export PYENV_ROOT="$HOME/.pyenv"' 'export PATH="$PYENV_ROOT/bin:$PATH"' "$([ -f "$profile" ] && cat "$profile")" > "$profile"
|
||||||
|
echo 'eval "$(pyenv init --path)"' >> "$profile"
|
||||||
|
echo 'eval "$(pyenv init -)"' >> "$rcfile"
|
||||||
|
echo 'eval "$(pyenv virtualenv-init -)"' >> "$rcfile"
|
||||||
|
|
||||||
|
Then **log out and log back in** and run the following command:
|
||||||
@@ -6,14 +6,7 @@ On distributions where Python 3.9 needs to be compiled from source, we recommend
|
|||||||
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
||||||
virtual environment.
|
virtual environment.
|
||||||
|
|
||||||
.. prompt:: bash
|
.. include:: _includes/_install-pyenv-and-setup-path.rst
|
||||||
|
|
||||||
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
|
||||||
|
|
||||||
**After this command, you may see a warning about 'pyenv' not being in the load path. Follow the
|
|
||||||
instructions given to fix that, then close and reopen your shell.**
|
|
||||||
|
|
||||||
Then run the following command:
|
|
||||||
|
|
||||||
.. prompt:: bash
|
.. prompt:: bash
|
||||||
|
|
||||||
|
|||||||
@@ -6,14 +6,7 @@ On distributions where Python 3.8 needs to be compiled from source, we recommend
|
|||||||
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
This simplifies the compilation process and has the added bonus of simplifying setting up Red in a
|
||||||
virtual environment.
|
virtual environment.
|
||||||
|
|
||||||
.. prompt:: bash
|
.. include:: _includes/_install-pyenv-and-setup-path.rst
|
||||||
|
|
||||||
command -v pyenv && pyenv update || curl https://pyenv.run | bash
|
|
||||||
|
|
||||||
**After this command, you may see a warning about 'pyenv' not being in the load path. Follow the
|
|
||||||
instructions given to fix that, then close and reopen your shell.**
|
|
||||||
|
|
||||||
Then run the following command:
|
|
||||||
|
|
||||||
.. prompt:: bash
|
.. prompt:: bash
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,18 @@ one-by-one:
|
|||||||
.. prompt:: bash
|
.. prompt:: bash
|
||||||
|
|
||||||
brew install python@3.9
|
brew install python@3.9
|
||||||
echo 'export PATH="$(brew --prefix)/opt/python@3.9/bin:$PATH"' >> ~/.profile
|
|
||||||
source ~/.profile
|
|
||||||
brew install git
|
brew install git
|
||||||
brew install --cask adoptopenjdk/openjdk/adoptopenjdk11
|
brew install --cask adoptopenjdk/openjdk/adoptopenjdk11
|
||||||
|
|
||||||
|
By default, Python installed through Homebrew is not added to the load path.
|
||||||
|
To fix this, you should run these commands:
|
||||||
|
|
||||||
|
.. prompt:: bash
|
||||||
|
|
||||||
|
profile=$([ -n "$ZSH_VERSION" ] && echo ~/.zprofile || ([ -f ~/.bash_profile ] && echo ~/.bash_profile || echo ~/.profile))
|
||||||
|
echo 'export PATH="$(brew --prefix)/opt/python@3.9/bin:$PATH"' >> "$profile"
|
||||||
|
source "$profile"
|
||||||
|
|
||||||
.. Include common instructions:
|
.. Include common instructions:
|
||||||
|
|
||||||
.. include:: _includes/create-env-with-venv.rst
|
.. include:: _includes/create-env-with-venv.rst
|
||||||
|
|||||||
Reference in New Issue
Block a user