From d976d6517772952670cbdbe7d3e6e7fce2480834 Mon Sep 17 00:00:00 2001 From: jackwenyoung Date: Sat, 24 Feb 2024 11:57:38 +0800 Subject: [PATCH] Add pyenv path setup to configuration.md --- book/configuration.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/book/configuration.md b/book/configuration.md index 6d594be97e1..2338191e221 100644 --- a/book/configuration.md +++ b/book/configuration.md @@ -163,3 +163,25 @@ $env.PATH = ($env.PATH | split row (char esep) | prepend '/opt/homebrew/bin') # Linux $env.PATH = ($env.PATH | split row (char esep) | prepend '/home/linuxbrew/.linuxbrew/bin') ``` + +### Pyenv +[Pyenv](https://github.com/pyenv/pyenv) is a popular Python version manager. To add it to your Nushell PATH: + +#### MacOS or Linux +```nu +# MacOS or Linux +$env.PATH = ($env.PATH | split row (char esep) | prepend $"(pyenv root)/shims") +``` + +#### Windows +Windows users need to install [pyenv-win](https://github.com/pyenv-win/pyenv-win) +and execute the `Get-Command pyenv` command in PowerShell to get the path of `pyenv.ps1` after the installation. + +The result usually looks like: `C:\Users\\.pyenv\pyenv-win\bin\pyenv.ps1` + +Then add the path of pyenv to your Nushell PATH: +```nu +# Windows +$env.Path = ($env.Path | split row (char esep) | prepend $"~/.pyenv/pyenv-win/bin/pyenv.ps1") +``` +