nix package missing
jihirmas
HOBBYOP

7 months ago

How do I install a extra pckg for building?

I am running:

"startCommand": "python scripts/preparestkobin.py && . scripts/linuxsetenv.sh && python -m app.main"

where the first command download .so files that I need to use in my app. The second one, add to env variables the location of this .so files in order to import them in python. Finally I run the app.

The logs show that the first command run correctly, the second one also, but I have a print in the first line of my main.py file, and it is not printing that. So I dont know where is the exact location of the error.

For context, the .sh is:

dd=/app/snap/stko/current

echo "Setting up environment variables for STKO..."

export QT_PLUGIN_PATH=$dd/dep_qt
export PYTHONPATH=$dd/dep_core:$PYTHONPATH
export LD_LIBRARY_PATH=$dd:$dd/dep:$dd/dep_core:$dd/dep_occ:$dd/dep_qt:$LD_LIBRARY_PATH:$dd/usr/lib/x86_64-linux-gnu
if [ ! -z "$1" ]; then
    fname="$(cd "$(dirname "$1")"; pwd)/$(basename "$1")"
fi

echo "Environment variables set:"

I am getting this error: python: error while loading shared libraries: libexpat.so.1: cannot open shared object file: No such file or directory

I tried creating a nixpacks.toml:

[phases.setup]
nixPkgs = [
  "python310",
  "expat",
  "postgresql_16.dev",
  "gcc"
]

[phases.install]
cmds = [
  "python -m venv --copies /opt/venv && . /opt/venv/bin/activate && pip install --upgrade pip && pip install -r requirements.txt"
]

and also:

[phases.setup]
nixPkgs = [
  "...",
  "expat"
]

Does anyone know why this can happen?

2 Replies

jihirmas
HOBBYOP

7 months ago

7a08b3ea-8e4f-4e2c-b85c-91ef57d5e5dd


jihirmas
HOBBYOP

7 months ago

Please I dont know what to do


Loading...