47 lines
710 B
Markdown
47 lines
710 B
Markdown
# pyenv install
|
|
|
|
## install
|
|
|
|
nice to have:
|
|
|
|
```bash
|
|
sudo apt install python-is-python3
|
|
```
|
|
|
|
```bash
|
|
curl https://pyenv.run | bash
|
|
```
|
|
|
|
## setup zsh
|
|
|
|
add the following to `.zshrc`:
|
|
|
|
```bash
|
|
export PYENV_ROOT="$HOME/.pyenv"
|
|
[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"
|
|
eval "$(pyenv init -)"
|
|
```
|
|
|
|
## pyenv install
|
|
|
|
prerequisites:
|
|
|
|
```bash
|
|
sudo apt update
|
|
sudo apt install build-essential libssl-dev zlib1g-dev \
|
|
libbz2-dev libreadline-dev libsqlite3-dev curl git \
|
|
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev \
|
|
libffi-dev liblzma-dev python3-pip
|
|
```
|
|
|
|
install:
|
|
|
|
```bash
|
|
# using python 3.12.7 as an example
|
|
pyenv install 3.12.7
|
|
|
|
# optional
|
|
pyenv global 3.12.7
|
|
pyenv versions
|
|
```
|