asdf-community / asdf-community/asdf-python

Can't use globally installed tools in project with local python version (Black tool)

Offen
#109 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Shell
Sterne
729
Forks
65
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I have two python versions installed via asdf:
- 3.9.6
- 3.8.11

I use `3.9.6` as a global version, and for my python project I set up a local version to `3.8.11`.
I have installed `Black` tool globally to integrate it with my IDE. I specify the full path to Black executable in PyCharm External Tools settings. It works everywhere except my project folder. I see the following output:

```shell
/home/user/.asdf/shims/black /home/user/repos/myproject/foo.py
grep: python 3.9.6
python system: No such file or directory
No preset version installed for command black
Please install a version by running one of the following:

asdf install python 3.8.11

or add one of the following versions in your config file at /home/user/repos/myproject/.tool-versions
python 3.9.6
```

My `.tool-versions` inside the project looks like this:
```plain
python 3.8.11
```

If I change it to 3.9.6 the Black tool is starting to work properly. But I do not want to fix it like this, I want to use python 3.8.11 with my project, and want to use Black as an external tool. Also, I tried to run `asdf reshim python` it doesn't fix problem too.

Could you help me with how to fix this problem?

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduziere den Befehl `/home/user/.asdf/shims/black` innerhalb des Projekts und vergleiche ihn mit dem Fall der globalen Version. Lies die `.tool-versions` des Projekts und untersuche das Verhalten von `asdf reshim python` sowie den Aufruf über PyCharm External Tools. Als abgeschlossen gilt die Aufgabe, wenn Black aus dem Projekt heraus ausgeführt wird, während lokal weiterhin Python 3.8.11 ausgewählt ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python, shell
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.