configure: checking for python....not found

Andrew Clayton andrew at digital-domain.net
Fri Sep 16 17:34:55 UTC 2022


On Fri, 16 Sep 2022 18:36:03 +0200
Ariel Goyeneche <agoyeneche at gmail.com> wrote:

> Hi Team,
> 
> I am trying hard to get nginx unit running with python 3.9.12 as a module.
> Given that the binaries are not available for nginx with this module, I am
> trying to compile nginx from source.
> The problem is that the ./configure python documentation is not clear for
> me.

If you installed python via your package manager then perhaps you are
simply missing the python-devel package, exact name will depend on your
distribution.

If you installed it manually yourself into some non-standard directory
then...
 
> --config=pathname. : what is this config referring to? my python
> 3.9.12 installation does not have any config file. Where can I find
> more information
> about this?

This is the path to the python-config script that will say how to build
against the python libraries. E.g

$ which python-config 
/usr/bin/python-config

[ side note
It outputs something like...

$ python-config --cflags --libs
-I/usr/include/python3.10 -I/usr/include/python3.10  -Wno-unused-result
-Wsign-compare  -O2  -fexceptions -g -grecord-gcc-switches -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS  -fstack-protector-strong   -m64
-mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
-fcf-protection -D_GNU_SOURCE -fPIC -fwrapv
-DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG  -O2  -fexceptions -g
-grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
-fstack-protector-strong   -m64  -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-D_GNU_SOURCE -fPIC -fwrapv -lcrypt -ldl  -lm -lm

all that gets passed to the compiler command.
]

You may need this depending on how you installed python.
 
> --lib-path=directory: is this the path to the python 3.9.12 lib folder?

I assume you can use this to say where unit can find the python DSO, e.g

$ locate libpython3.so
/usr/lib64/libpython3.so

That's from the Python3 package installed on Fedora.

Again, if you've installed python in a non-standard location you may
need to specify this.

> Regards,
> AG

Cheers,
Andrew



More information about the unit mailing list