2

A similar question was asked 3 years ago with no answers:

"ModuleNotFoundError: No module named 'zlib'” when I add python3 support with buildroot

And I have tried the comment that says to make clean.

I am trying to build a custom linux image using buildroot for a beaglebone. I have packaged a python application using the requests library (which imports zlib) to run on target.

Everything is properly installed on target, however when trying to run the application or running the following in python itself:

import zlib

I get a:

"ModuleNotFoundError: No module named 'zlib'"

In my config I have:

BR2_PACKAGE_PYTHON3=y
BR2_PACKAGE_PYTHON_REQUESTS=y

and python_requests has a config.in with:

select BR2_PACKAGE_PYTHON3_ZLIB

I have tried adding zlib by itself in my config:

BR2_PACKAGE_PYTHON3_ZLIB=y
BR2_PACKAGE_ZLIB=y

And I have tried changing zlib provider to zlib-ng:

BR2_PACKAGE_PROVIDES_ZLIB="zlib-ng"

But I still get the same error.

jdev
  • 21
  • 3

1 Answers1

0

I have solved this by using glibc in buildroot instead of mulibc.

jdev
  • 21
  • 3
  • 1
    This is not the reason. The reason is because when you change sub-options of the ```python3``` package, you need to manually force the rebuild of the python3 package (```make python3-dirclean all```) or do a full rebuild of the system (```make clean all```). – Thomas Petazzoni Oct 30 '22 at 09:05