Skip to contentSkip to conversation

No module named pkgconfig

DISCUSSION [email protected] 3 participants 7 messages Mar 14, 2024 – Mar 15, 2024

lore
Share & tools
lore
#0 lore raw

Trying to install wirepas_gateway package from pypi. It fails with error no module named pkgconfig. Below is the error

File "setup.py", line 17, in <module>
|     import pkgconfig
| ModuleNotFoundError: No module named 'pkgconfig'

SUMMARY = "Recipe to install Python PiP Package wirepas_gateway" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"

inherit pypi setuptools3
PYPI_PACKAGE = "wirepas_gateway" SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"

It is not able to locate pkgconfig. tried to export the path as found in one of the link using below, even that didn't worked out:
export PKG_CONFIG = "${STAGING_BINDIR_NATIVE}/pkg-config"

Any idea how to make pkgconfig available to the setup.py file

#1 lore raw
Quoted 14 lines · On 14 Mar 2024, at 14:40, ashujoshi35 via lists.yoctoproject.org…

Trying to install wirepas_gateway package from pypi. It fails with error no module named pkgconfig. Below is the error

File "setup.py", line 17, in <module>
| import pkgconfig
| ModuleNotFoundError: No module named 'pkgconfig'

SUMMARY = "Recipe to install Python PiP Package wirepas_gateway" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
inherit pypi setuptools3
PYPI_PACKAGE = "wirepas_gateway"
SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"

Quoted 5 lines

It is not able to locate pkgconfig. tried to export the path as found in one of the link using below, even that didn't worked out:
export PKG_CONFIG = "${STAGING_BINDIR_NATIVE}/pkg-config"

Any idea how to make pkgconfig available to the setup.py file

That’s python code trying to import pkgconfig, so you’ll need to DEPEND on python3-pkgconfig (there’s a recipe for that in meta-python).

Ross

#2 lore raw
Quoted 18 lines · Ross Burton
Quoted 2 lines · On 14 Mar 2024, at 14:40, ashujoshi35 via lists.yoctoproject.org…

Trying to install wirepas_gateway package from pypi. It fails with error

no module named pkgconfig. Below is the error

Quoted 5 lines

File "setup.py", line 17, in <module>
| import pkgconfig
| ModuleNotFoundError: No module named 'pkgconfig'

Quoted 8 lines

SUMMARY = "Recipe to install Python PiP Package wirepas_gateway" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
inherit pypi setuptools3
PYPI_PACKAGE = "wirepas_gateway"
SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"

It is not able to locate pkgconfig. tried to export the path as found in

Quoted 10 lines

one of the link using below, even that didn't worked out:

Quoted 4 lines

export PKG_CONFIG = "${STAGING_BINDIR_NATIVE}/pkg-config"

Any idea how to make pkgconfig available to the setup.py file

That’s python code trying to import pkgconfig, so you’ll need to DEPEND on python3-pkgconfig (there’s a recipe for that in meta-python).

devtool add <url to the git repository or pypi tarball> should have caught the dependency and mentioned it. It only knows about what has already been built, however.

Quoted 12 lines

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#62763):
https://lists.yoctoproject.org/g/yocto/message/62763
Mute This Topic: https://lists.yoctoproject.org/mt/104927594/924729
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

author
#3 lore raw

Added DEPENDS += "python3-pkgconfig python3 python3-pip"

but still face the same error. I can see its recipe in meta-python. Also, in the work directory recipe-sysroot/usr/lib pkgconfig directory is there with multiple .pc files. I can also see pkgconfig in recipe-syysroot/usr/lib/python3.8/site-packages/pkgconfig. pkgconfig here has _pycache_ directory, __init__.py and pkgconfig.py
Still setup.py is not able to find pkgconfig

Quoted 49 lines · Tim Orling
Quoted 18 lines · Ross Burton
Quoted 2 lines · On 14 Mar 2024, at 14:40, ashujoshi35 via lists.yoctoproject.org…

Trying to install wirepas_gateway package from pypi. It fails with

error no module named pkgconfig. Below is the error

Quoted 5 lines

File "setup.py", line 17, in <module>
| import pkgconfig
| ModuleNotFoundError: No module named 'pkgconfig'

Quoted 8 lines

SUMMARY = "Recipe to install Python PiP Package wirepas_gateway" LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=cb6bb17b0d0cca188339074207e9f4d8"
inherit pypi setuptools3
PYPI_PACKAGE = "wirepas_gateway"
SRC_URI[md5sum] = "941a4407513445c64f16b57a1474fc43"

It is not able to locate pkgconfig. tried to export the path as found

Quoted 10 lines

in one of the link using below, even that didn't worked out:

Quoted 4 lines

export PKG_CONFIG = "${STAGING_BINDIR_NATIVE}/pkg-config"

Any idea how to make pkgconfig available to the setup.py file

That’s python code trying to import pkgconfig, so you’ll need to DEPEND on python3-pkgconfig (there’s a recipe for that in meta-python).

devtool add <url to the git repository or pypi tarball> should have caught the dependency and mentioned it. It only knows about what has already been built, however.

Quoted 12 lines

Ross
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#62763):
https://lists.yoctoproject.org/g/yocto/message/62763
Mute This Topic: https://lists.yoctoproject.org/mt/104927594/924729
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#4 lore raw
Quoted 5 lines · Ashu Joshi via lists.yoctoproject.org

Added DEPENDS += "python3-pkgconfig python3 python3-pip"

but still face the same error. I can see its recipe in meta-python. Also, in the work directory recipe-sysroot/usr/lib pkgconfig directory is there with multiple .pc files. I can also see pkgconfig in recipe-syysroot/usr/lib/python3.8/site-packages/pkgconfig. pkgconfig here has _pycache_ directory, __init__.py and pkgconfig.py Still setup.py is not able to find pkgconfig

It’s built-time Python trying to find code, so you want python3-pkgconfig-native. Built-time Python won’t run code in the _target_ sysroot.

Ross

author
#5 lore raw

Thanks Ross. I am able to resolve the error after using pkg-config-native. For my understanding, can you please explain the difference between pkgconfig and pkgconfig-native. When are we supposed to use pkgconfig.? I am relatively new to this, so I want to understand this better.

Quoted 17 lines · Ross Burton
Quoted 4 lines · Ashu Joshi via lists.yoctoproject.org

Added DEPENDS += "python3-pkgconfig python3 python3-pip"

but still face the same error. I can see its recipe in meta-python.

Also, in the work directory recipe-sysroot/usr/lib pkgconfig directory is there with multiple .pc files. I can also see pkgconfig in recipe-syysroot/usr/lib/python3.8/site-packages/pkgconfig. pkgconfig here has _pycache_ directory, __init__.py and pkgconfig.py

Quoted 1 line

Still setup.py is not able to find pkgconfig

It’s built-time Python trying to find code, so you want python3-pkgconfig-native. Built-time Python won’t run code in the _target_ sysroot.

Ross

#6 lore raw
Quoted 3 lines · Ashu Joshi

Thanks Ross. I am able to resolve the error after using pkg-config-native. For my understanding, can you please explain the difference between pkgconfig and pkgconfig-native. When are we supposed to use pkgconfig.? I am relatively new to this, so I want to understand this better.

Any recipe that is -native is for running on the build machine. So pkgconfig-native builds and provides a pkgconfig binary that you can run at build time. Otherwise the binaries are for the target, which isn’t any good if you need to run it on the build machine.

Ross