asdf-community / asdf-community/asdf-python

"No preset version installed for command clear" after installing python 3.12.3 and anaconda3-2024.02-1

Aperta
#187 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Shell
Stelle
729
Fork
65
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Provide environment information

```bash
➜ ~ asdf info
OS:
Darwin MiMacBookAir.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 arm64

SHELL:
zsh 5.9 (x86_64-apple-darwin23.0)

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.14.0

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/USERNAME/.asdf
ASDF_DIR=/opt/homebrew/opt/asdf/libexec
ASDF_CONFIG_FILE=/Users/USERNAME/.asdfrc

ASDF INSTALLED PLUGINS:
java https://github.com/halcyon/asdf-java.git master 8aef0e7
node https://github.com/asdf-vm/asdf-nodejs.git master c5b7c40
python https://github.com/asdf-community/asdf-python.git master 5e277e2
```

### To Reproduce

asdf install python 3.12.3
asdf global python 3.12.3
asdf install python anaconda3-2024.02-1
asdf global python anaconda3-2024.02-1
asdf global python 3.12.3
Restart terminal or $SHELL
enter "clear"

I found closed but related issues on this matter:
https://github.com/asdf-vm/asdf/issues/414
https://github.com/asdf-community/asdf-python/issues/31

### Describe the Bug

After installing python 3.12.3 and anaconda3-2024.02-1 then switching back and forth between versions; the "clear" command on terminal does not work. It does not clear my terminal screen but receive an error message.

➜ ~ clear
No preset version installed for command clear
Please install a version by running one of the following:

asdf install python 3.12.3

or add one of the following versions in your config file at /Users/USERNAME/.tool-versions
python anaconda3-2024.02-1

➜ ~ cat .tool-versions
node 20.12.2
python 3.12.3
java zulu-javafx-21.34.19

This error does not occur when I switch back to anaconda3-2024.02-1 from python 3.12.3 and enter "clear" when I have set python 3.12.3 globally.
This also occurred on my Ubuntu machine. However, I "sudo apt reinstall ncurses-bin" and this fixed the issue for ubuntu.

Work around for macOS:
1. add and alias: alias clear="/usr/bin/clear"
2. Not recommended by Homebrew but after installing ncurses via homebrew:
brew link --force ncurses
echo 'export PATH="/opt/homebrew/opt/ncurses/bin:$PATH"' >> ~/.zshrc
$SHELL

### Expected Behaviour

After switching from anaconda to python 3.12.3 by using the asdf global command I should be able to clear my terminal screen without any issues. I am not sure why asdf shims or has a clear or why it supersedes the system's clear.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia riproducendo la sequenza di cambio della versione di Python indicata, quindi esamina il comportamento degli asdf shims, di PATH e di .tool-versions in relazione al comando clear. Confronta il comando che fallisce con /usr/bin/clear e con la soluzione alternativa relativa a ncurses descritta nel report. Il lavoro è completato quando clear funziona dopo il passaggio tra le versioni di Python specificate senza richiedere un alias o una modifica manuale di PATH.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python, shell
Ambito
cli, tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.