fix(python): update version checks

This commit is contained in:
AJ ONeal
2022-09-28 07:22:58 +00:00
parent f5216315d1
commit c7d761bbb2
3 changed files with 10 additions and 12 deletions

View File

@@ -25,7 +25,7 @@ sudo apt update
sudo apt install -y build-essential zlib1g-dev libssl-dev
# recommended
sudo apt install -y libreadline-dev libbz2-dev libsqlite3-dev
sudo apt install -y libreadline-dev libbz2-dev libsqlite3-dev libffi-dev
```
## Cheat Sheet
@@ -40,23 +40,23 @@ pre-requisites above).
Here's how you can check for the latest version:
```sh
pyenv install --list | grep -v -- - | tail -n 1
#> 3.9.1
pyenv install --list | grep -E '^\s+[0-9.]+$' | tail -n 1
#> 3.10.7
```
And install it:
```sh
pyenv install -v 3.9.1
#> Installed Python-3.9.1 to ~/.pyenv/versions/3.9.1
pyenv install -v 3.10.7
#> Installed Python-3.10.7 to ~/.pyenv/versions/3.10.7
```
And use it:
```sh
pyenv global 3.9.1
pyenv global 3.10.7
python --version
#> Python 3.9.1
#> Python 3.10.7
```
Revert back to your system python:
@@ -72,7 +72,7 @@ pyenv install --list
```
```txt
3.9.1
3.10.7
activepython-3.6.0
anaconda3-2020.11
graalpython-20.3.0

View File

@@ -17,8 +17,7 @@ __init_python() {
my_latest_python3="$(
pyenv install --list |
grep -v -- - |
grep '3\.[0-9]\+\.[0-9]\+$' |
grep -E '^\s+3\.[0-9]+\.[0-9]+$' |
tail -n 1 |
cut -d' ' -f3
)"

View File

@@ -17,8 +17,7 @@ __init_python2() {
my_latest_python2="$(
pyenv install --list |
grep -v -- - |
grep '2\.[0-9]\+\.[0-9]\+$' |
grep -E '^\s+2\.[0-9]+\.[0-9]+$' |
tail -n 1 |
cut -d' ' -f3
)"