Even though binary file for pip3.9 present in my environment, I am seeing pip3.9 not found error
Asked by NAGENDRABABU BONKURI:

Hi, I am using docker image ubuntu:20.04, and creating custom docker image. My bitbucket-pipelines.yml looks like below:

"image: ubuntu:20.04

pipelines:  
branches:  
'{next,main,staging-\*}':  
- parallel:  
- step:  
name: 'Build tplink_ex447'  
size: 2x  
script:  
- apt update  
- apt install -y git-core make curl unzip python3 python3-yaml  
- curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"  
- unzip awscliv2.zip  
- ./aws/install  
- git config --global user.email "you@example.com"  
- git config --global user.name "Your Name"  
- make -j TARGET=tplink_ex447  
services:  
- docker

definitions:  
services:  
docker:  
memory: 7128"

I can see pip3.9 package binary file at /opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin/ directory, but still seeing pip3.9 not found error in bitbucket pipeline logs:

the logs are looks like below:

"cp -fpR /opt/atlassian/pipelines/agent/build/tip/openwrt/../../feeds/netexp/schema/PyYAML.txt /opt/atlassian/pipelines/agent/build/tip/openwrt/feeds/packages/lang/python/host-pip-requirements  
SHELL= flock /opt/atlassian/pipelines/agent/build/tip/openwrt/tmp/.pip.flock -c ' ARCH="x86_64" CC="gcc" CCSHARED="gcc -DPIC -fPIC" CXX="g++" LD="gcc" LDSHARED="gcc -shared" CFLAGS="-O2 -I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/host/include -I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/include -I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/target-arm_cortex-a7_musl_eabi/host/include" CPPFLAGS="-I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/host/include -I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/include -I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/target-arm_cortex-a7_musl_eabi/host/include -I/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/include/python3.9" LDFLAGS="-L/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/host/lib -L/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/lib -L/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/target-arm_cortex-a7_musl_eabi/host/lib -lpython3.9 -Wl,-rpath,/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/lib" PYTHONPATH="/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/lib/python3.9:/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/lib/python3.9/site-packages" PYTHONDONTWRITEBYTECODE=0 PYTHONOPTIMIZE="" /opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin/pip3.9 --cache-dir "/opt/atlassian/pipelines/agent/build/tip/openwrt/dl/pip-cache" --disable-pip-version-check install --no-binary :all: --require-hashes --requirement /opt/atlassian/pipelines/agent/build/tip/openwrt/feeds/packages/lang/python/host-pip-requirements/PyYAML.txt '  
HDRINST usr/include/rdma/hns-abi.h  
/bin/sh: 1: **/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin/pip3.9: not found**   
make\[3\]: \*\*\* \[Makefile:73: /opt/atlassian/pipelines/agent/build/tip/openwrt/build_dir/target-arm_cortex-a7_musl_eabi/ucentral-schema-2021-02-15-6d321d65/.built\] Error 127  
make\[3\]: Leaving directory '/opt/atlassian/pipelines/agent/build/tip/feeds/ucentral/ucentral-schema'  
time: package/feeds/ucentral/ucentral-schema/compile#1.10#0.20#2.56  
ERROR: package/feeds/ucentral/ucentral-schema failed to build.  
make\[2\]: \*\*\* \[package/Makefile:116: package/feeds/ucentral/ucentral-schema/compile\] Error 1"

I can run build in my local linux environment successfully, but not seeing same on bitbucket pipeline


Answers:
author: Norbert C
body: Hi [@NAGENDRABABU BONKURI](/t5/user/viewprofilepage/user-id/4781604)

Thank you for contacting Atlassian Community, I'm Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you!

Based on my observation, your build is failing with the following error:

```
/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin/pip3.9: not found
```

What this error means is that this file can't be found at this path. Would it be possible for you to give us the output of the following command, please?

```
ls -lthra /opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin
```

In case the file is there, can you change the permission on this file by doing the following command?

```
chmod 777?/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin/pip3.9
```

Please let us know how it goes, we're here to help :)

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support

comments: author: Nagendrababu Bonkuri
body: Hi [@Norbert C](/t5/user/viewprofilepage/user-id/1190200) , thank you for responding to my query. I can see the binary file at

```
/opt/atlassian/pipelines/agent/build/tip/openwrt/staging_dir/hostpkg/bin/
```

directory, and the permissions also look good. The only thing I was missing is to add python3 host build dependancy in my local Makefile specific to my package. Once I did that trick it worked.


author: Norbert C
body: Hi [@NAGENDRABABU BONKURI](/t5/user/viewprofilepage/user-id/4781604)

Thank you for your reply, I'm glad to hear your issue is resolved :).

Have a great weekend ahead!

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

docker