asdf-community / asdf-community/asdf-python
Default packages fail to install if `PIP_REQUIRE_VIRTUALENV` is set
- Vorherrschende Sprache
- Shell
- Sterne
- 729
- Forks
- 65
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
When installing a new Python version, it failed when attempting to install default packages:
```
Installed Python-3.11.4 to /Users/myusername/.asdf/installs/python/3.11.4
Installing default python packages...ERROR: Could not find an activated virtualenv (required).
```
This is because I have `PIP_REQUIRE_VIRTUALENV` set to `true` in my shell. Looking at the install command, it uses `pip` as such:
https://github.com/asdf-community/asdf-python/blob/8505457c6612514688ba473386d2063d4c83bb54/bin/install#L38
According to [this Stack Overflow answer](https://stackoverflow.com/a/30515378), I believe this command should include the `--isolated` flag. In my case, adding the flag works:
```
$ pip install -U -r ~/.default-python-packages
ERROR: Could not find an activated virtualenv (required).
$ pip install -U -r ~/.default-python-packages --isolated
Requirement already satisfied: ...
```
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Untersuche bin/install in der Nähe von Zeile 38, wo die Standardpakete mit pip installiert werden. Reproduziere den Fehler mit PIP_REQUIRE_VIRTUALENV=true und ~/.default-python-packages und überprüfe anschließend, dass die Installation einer neuen Python-Version abgeschlossen wird und die Standardpakete ohne den virtualenv-Fehler installiert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, shell
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 48/100