|
| 1 | +### asdf |
| 2 | + |
| 3 | +* Install from the [Setup](../README.md#setup) section |
| 4 | +* WSL/Ubuntu Linux dependencies |
| 5 | + ```bash |
| 6 | + sudo apt update && sudo apt install \ |
| 7 | + make build-essential libssl-dev zlib1g-dev \ |
| 8 | + libbz2-dev libreadline-dev libsqlite3-dev wget \ |
| 9 | + curl llvm libncursesw5-dev xz-utils tk-dev \ |
| 10 | + libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev |
| 11 | + ``` |
| 12 | +* Fedora dependencies |
| 13 | + ```bash |
| 14 | + sudo dnf install -y bzip2-devel libsqlite3x-devel |
| 15 | + ``` |
| 16 | +* All operating systems |
| 17 | + ```bash |
| 18 | + # add python plugin |
| 19 | + asdf plugin-add python |
| 20 | +
|
| 21 | + # install stable python |
| 22 | + asdf install python latest |
| 23 | +
|
| 24 | + # uninstall version |
| 25 | + asdf uninstall python 3.9.6 |
| 26 | +
|
| 27 | + # refresh symlinks for installed python runtimes |
| 28 | + asdf reshim python |
| 29 | +
|
| 30 | + # set stable to system python |
| 31 | + asdf global python latest |
| 32 | +
|
| 33 | + # optional: local python (e.g., python 3.9.10) |
| 34 | + cd $work_dir |
| 35 | + asdf list-all python 3.9 |
| 36 | + asdf install python 3.9.10 |
| 37 | + asdf local python 3.9.10 |
| 38 | +
|
| 39 | + # verify python shim in use |
| 40 | + asdf current |
| 41 | +
|
| 42 | + # check installed python |
| 43 | + asdf list python |
| 44 | + ``` |
| 45 | + |
| 46 | +#### Debugging |
| 47 | +**No version set for command python** |
| 48 | +* Make sure `python` or `python3` isn't aliased in `~/.bashrc` or `~/.zshrc` |
| 49 | +
|
| 50 | +[bash - Is it possible to check where an alias was defined? - Unix & Linux Stack Exchange](https://unix.stackexchange.com/questions/322459/is-it-possible-to-check-where-an-alias-was-defined/544970#544970) |
| 51 | +
|
| 52 | +##### PATH |
| 53 | +* `asdf`, `poetry`, and `python` all need to be sourced in your shell `$PATH` in a specific order |
| 54 | + * `asdf` stores its Python shims in `~/.asdf/shims` |
| 55 | + * `poetry` lives in `~/.local/bin` |
| 56 | + ```bash |
| 57 | + export ASDF_DIR="$HOME/.asdf" |
| 58 | + export PATH="$ASDF_DIR/shims:$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" |
| 59 | + ``` |
| 60 | +* Furthermore, any aliases or alias files need to be sourced as well |
| 61 | + ```bash |
| 62 | + . "$ASDF_DIR/asdf.sh" |
| 63 | + . "$ASDF_DIR/completions/asdf.bash" |
| 64 | + . /usr/local/etc/profile.d/poetry.bash-completion |
| 65 | + ``` |
0 commit comments