-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_python_versions.sh
More file actions
executable file
·22 lines (18 loc) · 1007 Bytes
/
install_python_versions.sh
File metadata and controls
executable file
·22 lines (18 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# To execute this from a command prompt:
# curl https://raw.githubusercontent.com/upside-services/python-setup-scripts/master/install_python_versions.sh | bash
#
# Prerequisites: Pyenv is installed with the pyenv-alias-latest-patch-version plugin. See
# https://raw.githubusercontent.com/upside-services/python-setup-scripts/master/install_pyenv.sh
PYTHON_VERSIONS=(3.6 3.7 3.8 3.9)
for python_version in ${PYTHON_VERSIONS[@]}; do
echo "Installing latest Python ${python_version}"
pyenv install ${python_version}:latest
PYENV_VERSION=${python_version} python -m pip install --upgrade pip wheel
done
# Set the default version to 3.6
# This lets 3.6 be ambient for projects that don't yet have .python-version.
# So by default `python` will map to 3.6.
# Other versions are added to support tox which invokes python using major and minor, like `python3.7`
# Without declaring these `global` pyenv will error with `pyenv: foo: command not found`
pyenv global ${PYTHON_VERSIONS[@]}