Back

How to find the path of the package installed in the function using the build command

  • 0
  • Functions
Abhishek
26 Sep, 2023, 19:04

I built the function using python 3.11 runtime. I'm using the pdf2image python-pip package. However this package depends on poppler-utils at os-level.

To achieve this, I'm using the following build command: apk update && apk add --upgrade poppler-utils && pip install -r requirements.txt

But the issue still persists. pdf2oimage still not able to find the poppler path

TL;DR
The user is having trouble finding the path of a package installed in a function using the build command. They are using an Apple M1 chip and have encountered an "OSError: [Errno 8] Exec format error" when trying to build. The suggestion is to download a binary and include it in the code instead of installing via apk. The user has provided build logs showing the installation process, but the issue still persists. They are using the pdf2image package, which depends on poppler-utils at the OS level. The build command they are using is "apk update && apk add --upgrade poppler-utils && pip install
Abhishek
26 Sep, 2023, 19:05

Build logs:

TypeScript
Preparing for build ...
Building ...
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.16/community/x86_64/APKINDEX.tar.gz
(1/23) Upgrading musl (1.2.3-r2 -> 1.2.3-r3)
(2/23) Installing libxau (1.0.9-r0)
(3/23) Installing libxdmcp (1.1.3-r0)
(4/23) Installing libxcb (1.15-r0)
(5/23) Installing libx11 (1.8-r1)
(6/23) Installing libxext (1.3.4-r0)
(7/23) Installing libxrender (0.9.10-r3)
(8/23) Installing brotli-libs (1.0.9-r6)
(9/23) Installing libpng (1.6.37-r1)
(10/23) Installing freetype (2.12.1-r0)
(11/23) Installing fontconfig (2.14.0-r0)
(12/23) Installing pixman (0.40.0-r4)
(13/23) Installing cairo (1.17.4-r2)
(14/23) Installing lcms2 (2.13.1-r0)
(15/23) Installing libjpeg-turbo (2.1.3-r1)
(16/23) Installing openjpeg (2.5.0-r0)
(17/23) Installing libgcc (11.2.1_git20220219-r2)
(18/23) Installing libstdc++ (11.2.1_git20220219-r2)
(19/23) Installing libwebp (1.2.3-r2)
(20/23) Installing zstd-libs (1.5.2-r1)
(21/23) Installing tiff (4.4.0-r4)
(22/23) Installing poppler (22.05.0-r0)
(23/23) Installing poppler-utils (22.05.0-r0)
Executing busybox-1.35.0-r17.trigger
OK: 31 MiB in 58 packages
Drake
27 Sep, 2023, 00:58

hmmm so the problem is the place where the build happens, isn't the same place as where your code runs.

any chance you can donwload some sort of binary and include that in your code instead of installing via apk?

Abhishek
27 Sep, 2023, 07:16

I need to check the possibility

Abhishek
27 Sep, 2023, 08:43

I tried with binary approach, but now I'm stuck with following error: OSError: [Errno 8] Exec format error

Drake
27 Sep, 2023, 19:49

Did you use a binary for alpine? X86 or arm?

Abhishek
28 Sep, 2023, 17:34

python3.11-apline

Abhishek
28 Sep, 2023, 17:35

I'm not sure about x86 or ARM. I'm generating the binary and libs through the docker container running on Apple M1 chip. I will check which arch is the output

Drake
28 Sep, 2023, 18:07

apple M1 would be an arm-based CPU

Drake
28 Sep, 2023, 18:07

so wherever you deploy would need to also be arm-based

Abhishek
28 Sep, 2023, 19:09

Noted! I will retry tomorrow. Thank you Steven

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more