# Linux

Pyenv builds Python from source, which means you’ll need build dependencies to actually use it. The build dependencies vary by platform. If you are on **Ubuntu/Debian** and want to install the build dependencies, you could use the following:

```
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
```

After you’ve installed the build dependencies, you’re ready to install `pyenv` itself. We recommend using the [pyenv-installer project](https://github.com/pyenv/pyenv-installer):

```
curl https://pyenv.run | bash
```

At the end of the installation you will see something similar to:

```
WARNING: seems you still have not added 'pyenv' to the load path.

# Load pyenv automatically by adding
# the following to ~/.bashrc:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
```

Follow the instructions that will appear to add the paths to your /.bashrc file and then start a new shell session.:

```
exec "$SHELL" # Or just restart your terminal
```

This command will show a list of Python versions:

```
pyenv install --list
```

Now let's install the latest Python version (3.8.5 as of this writing):

```
pyenv install 3.8.5
```

Now that Python 3 is installed through pyenv, we want to set it as our global default version for pyenv environments:

```
$ pyenv global 3.8.5
# and verify it worked
$ pyenv version
```

Run this command to see the system Python's version after the change:

```
python -V
```

Sources:

* <https://realpython.com/intro-to-pyenv/>
* <https://github.com/pyenv/pyenv>


---

# 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.productizeml.com/productize-ml/hands-on/python-ml/python-installation/python_linux.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.
