The necessary bits to build these optional modules were not found

I am seeing some modules are not being built and the build log is as follows

The necessary bits to build these optional modules were not found:
_hashlib _multiprocessing _posixshmem
_sqlite3 _ssl _tkinter
_uuid mmap nis
ossaudiodev spwd

_multiprocessing, mmap and hashlib and these are the modules I require. Any reason why they are not being built, When I checked the sources everything seems to be fine. has anyone faced this before. PS I am building a 32 bit build.

You are running ./configure I assume.

Read its output carefully as it will will tell you what has and has not been found on your system.

You will need to tell configure where to look for the dependencies for any that it cannot find automatically.

Yes Barry I am running ./configure. The config logs show up as follows

configure:23872: checking for stdlib extension module _multiprocessing
configure:23902: result: missing

py_cv_module__multiprocessing=missing

I am looking into configure file, any suggestions as to where to start from or go to?

It would help if you tell us your operating system.

Configure files are machine generated and hard to read.
But if you look for references to get modules you should be able to figure what the test code is looking for.

Also you should get useful clues by reading the code of the multiprocessing module and see what it includes as header files and uses an external functions.

1 Like

It’s not a conventional OS Steven, rather it’s a legacy system with a rapper on top of earlier versions of linux with limited functionality.

Doesn’t matter. It still helps to know the operating system, even if only to distinguish between Windows or a POSIX system.

What version of Linux is it based on? Do you still have any access at all to the Linux package manager?

If you do, there are probably Linux packages that you can install that will help.

When libraries don’t build, that often means that you are missing the Linux dev packages. On a Red Hat based system, they are probably called something like:

  • sqlite-devel
  • tk-devel
  • openssl-devel

etc. One thing you might try is build a minimal version of your underlying Linux distro, and try building Python on it. Work out what packages are missing (google and duckduckgo often help with that). Work out what files are added by the package manager, the package manager itself probably has a command to list the content of a package, and you can backport them to your custom Linux.

Also, if you are building a specialised system with limited functionality, say for an embedded system with no GUI, there may be no need to install some optional packages like Tkinter (needs a GUI).

1 Like

Can we build multiprocessing module without the support of posix shared memory library? Even if we do will it work properly?
I was able to build other modules that I require, thank you Steven and Barry for your insights.
However to build multiprocessing module I see posix shared memory is a requirement but I want to bypass this. Is it possible for 3.11.1?

Can we build multiprocessing module without the support of posix shared memory library? Even if we do will it work properly?
I was able to build other modules that I require, thank you Steven and Barry for your insights.
However to build multiprocessing module I see posix shared memory is a requirement but I want to bypass this. Is it possible for 3.11.1?