Python run fails because the installation does not have required system dependencies

Open
#70 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
docker, python

Research direction

Start by reproducing the failure with trial.Dockerfile and pkgm install python@3.12, then inspect how the package is installed in the pkgxdev/pkgx image and how its shared library is exposed. Done means the Docker build completes and prints "hello world" without the missing libpython3.12.so.1.0 error.

Written by the indexing model from the issue text.

Description

Python 3.12 installed via pkgx does not work within docker. Python run fails with message

python: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory

Simulation steps

  • Create a docker file named trial.Dockerfile with the following contents
FROM pkgxdev/pkgx

RUN pkgm install python@3.12

RUN python -c 'print("hello world")'
  • Run command docker build -f trial.Dockerfile -t trial:latest .

Expected behaviour

Docker build must be successful and "hello world" must be printed

Actual behaviour

Errors out with message python: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory

Full log
[+] Building 1.2s (6/6) FINISHED                                                                                                               docker:colima
 => [internal] load build definition from trial.Dockerfile                                                                                              0.0s
 => => transferring dockerfile: 128B                                                                                                                    0.0s
 => [internal] load metadata for docker.io/pkgxdev/pkgx:latest                                                                                          0.9s
 => [internal] load .dockerignore                                                                                                                       0.0s
 => => transferring context: 2B                                                                                                                         0.0s
 => [1/3] FROM docker.io/pkgxdev/pkgx:latest@sha256:3cb64e57aede0ce66da3e5be729d7f72d46119a1583aa69e69b60e7d419d58b2                                    0.0s
 => CACHED [2/3] RUN pkgm install python@3.12                                                                                                           0.0s
 => ERROR [3/3] RUN python -c 'print("hello world")'                                                                                                    0.2s
------                                                                                                                                                       
 > [3/3] RUN python -c 'print("hello world")':
0.158 python: error while loading shared libraries: libpython3.12.so.1.0: cannot open shared object file: No such file or directory
------
trial.Dockerfile:5
--------------------
   3 |     RUN pkgm install python@3.12
   4 |     
   5 | >>> RUN python -c 'print("hello world")'
--------------------
ERROR: failed to build: failed to solve: process "/bin/sh -c python -c 'print(\"hello world\")'" did not complete successfully: exit code: 127

Possible fix

Dominant language
TypeScript
Stars
60
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pkgxdev/pkgm

All issues in pkgxdev/pkgm

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.