# pyenv

## Installation

{% hint style="info" %}
**Note for future me** -> Installing my dotfiles repo takes care of this

*Skip to* [#usage](#usage "mention")
{% endhint %}

<pre class="language-bash" data-overflow="wrap"><code class="lang-bash"><strong>git clone https://github.com/pyenv/pyenv.git ~/.pyenv
</strong>cd ~/.pyenv &#x26;&#x26; src/configure &#x26;&#x26; make -C src

git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv

# vvv !! The following goes into .zshrc !! vvv
# pyenv stuff
export PYENV_ROOT="$HOME/.pyenv"
[[ -d $PYENV_ROOT/bin ]] &#x26;&#x26; export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
</code></pre>

## Usage

```bash
sudo pacman -S tk
# tab completion to check latest versions
pyenv install 3.12.3
pyenv virtualenv 3.12.3 venv-name
# this automatically switches to the correct venv within a directory
pyenv local venv-name

# can also use "pyenv local 3.12.3"
# don't use "pyenv global ..." imo
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.specarino.com/specs-corner/python/pyenv.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
