mirror of
https://github.com/webinstall/webi-installers.git
synced 2026-02-14 09:39:51 +00:00
fix(python): update version checks
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
)"
|
||||
|
||||
@@ -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
|
||||
)"
|
||||
|
||||
Reference in New Issue
Block a user