devcontainers / devcontainers/features

Need --enabled-shared (aka python-dev) for Python feature

Offen
#746 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
needs-more-info
Vorherrschende Sprache
Shell
Sterne
1.5k
Forks
621
Ø Merge
6 T. 53 Min.
Gemergte PRs (30 T.)
9

Beschreibung

AFAICT no way to `--enable-shared` for [Python feature](https://github.com/devcontainers/features/tree/main/src/python#python-python).

I ran into this with:
```json
"image": "mcr.microsoft.com/devcontainers/universal:2",
"features": {
"ghcr.io/devcontainers/features/python:1": {
"version": "3.11.4"
},

```

And tried to use `pyinstaller`, but fails with:

```
OSError: Python library not found: libpython3.11m.so.1.0, libpython3.11.so.1.0, libpython3.11.so, libpython3.11mu.so.1.0, libpython3.11m.so
This means your Python installation does not come with proper shared library files.
This usually happens due to missing development package, or unsuitable build parameters of the Python installation.

* On Debian/Ubuntu, you need to install Python development packages:
* apt-get install python3-dev
* apt-get install python-dev
* If you are building Python by yourself, rebuild with `--enable-shared` (or, `--enable-framework` on macOS).
```

Somewhat confusingly `apt-get install` gives:
```
python3-dev is already the newest version (3.8.2-0ubuntu2).
```

But I'm _guessing_ that's no use because `ghcr.io/devcontainers/features/python` has built / installed its own Python, and that's what `pyinstaller` is using.

Other option is `--enable-shared`, but I'm not sure how to do that since the Python feature handles building Python.

---

Note that if requested version is available in Oryx then I think you get `--enable-shared` by default [because this](https://github.com/microsoft/Oryx/blob/e27125bc919a4515ade7d515e4d88493f68a3c61/platforms/python/prereqs/build.sh#L84), so perhaps is should be on by default when building from source too?

Otherwise, for example, a Python could be added to Oryx and now suddenly you'd get `--enabled-shared` behavior when you previously didn't. I don't know if Oryx prunes older versions, but I can also envisage it suddenly not being `--enable-shared` if that does happen.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Beginne mit dem Python-Feature unter src/python und verfolge, wie angeforderte Versionen erstellt oder installiert werden. Vergleiche sein Verhalten mit der verknüpften Referenz platforms/python/prereqs/build.sh von Oryx und überprüfe anschließend, dass die angeforderte Option oder der Standardwert gemeinsam genutzte Python-Bibliotheken erzeugt, die von pyinstaller verwendet werden können.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
devops
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

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