./configure: : python: command not found

12 views
Skip to first unread message

Satinder Singh

unread,
Apr 6, 2021, 5:55:55 PMApr 6
to modwsgi
I am trying to follow this documentation here:


However, when I execute .configure (to configure the source code of mod_wsgi), I keep getting the following errors:

checking for python... no

./configure: line 2849: python: command not found

./configure: line 2853: python: command not found

./configure: line 2861: python: command not found

./configure: line 2866: python: command not found

./configure: line 2880: python: command not found

./configure: line 2884: python: command not found

./configure: line 2887: python: command not found

./configure: line 2890: python: command not found

./configure: line 2893: python: command not found

./configure: line 2919: python: command not found

./configure: line 2922: python: command not found

./configure: line 2964: apxs: command not found

configure: creating ./config.status

config.status: creating Makefile


What is a solution to this? Please advise.

Graham Dumpleton

unread,
Apr 6, 2021, 5:58:30 PMApr 6
to mod...@googlegroups.com
At a guess, you only have Python 3 installed and it doesn't provide a link from python to python3, plus you don't have Apache devel package installed either.

Ensure you install the appropriate Apache devel package for you your operating system variant.

Then use:

    ./configure --with-python python3

to tell configure the name of the Python program.

Graham

--
You received this message because you are subscribed to the Google Groups "modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to modwsgi+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/19c29353-9669-4844-a01e-d32c5f133064n%40googlegroups.com.

Satinder Singh

unread,
Apr 6, 2021, 6:33:22 PMApr 6
to modwsgi
Thanks Graham,

1- I installed httpd-devel successfully.
2 - Have the following PATH in my .bash_profile

# User specific environment and startup programs

PATH=$PATH:$HOME/bin:/usr/local/python/Python-3.9.2

export PATH

3- When I execute ./configure --with-python python3, I get the following message:

checking Apache version... 2.4.37

followed by the message below multiple times:

yes: invalid option -- 'c'

Try 'yes --help' for more information.

yes: invalid option -- 'c'

Try 'yes --help' for more information.

and finally terminating with the below messages:

configure: creating ./config.status

config.status: creating Makefile

4 - There is some content in these files, but wouldn't know what to do next. I am completely new to this world of modwsgi . Neither does the guide that I listed in my original post makes any mention of these two files.

Regards 

Graham Dumpleton

unread,
Apr 6, 2021, 6:36:55 PMApr 6
to mod...@googlegroups.com
What operating system are you using?

Also, the PATH doesn't really look quite right since Python executable would usually be in a "bin" directory. What do you get for:

    which python3

Satinder Singh

unread,
Apr 6, 2021, 6:47:57 PMApr 6
to modwsgi
I am on CentOS 8 and Python version is 3.9.2. As a matter of fact completely new to Python as well and the Django web framework that I am attempting to run. 

Graham Dumpleton

unread,
Apr 6, 2021, 6:50:33 PMApr 6
to mod...@googlegroups.com
You didn't answer the question of what you get for:

    which python3

Also, why do you have Python in:

    /usr/local/python/Python-3.9.2

Did you install this from source code yourself? Why aren't you using the Python that CentOS provides? Installing Python from source code can cause various problems if you don't configure it correctly.

Also, what do you get for running:

    which yes

Graham

Satinder Singh

unread,
Apr 6, 2021, 7:07:18 PMApr 6
to modwsgi
My answers below:

which python3 > /usr/bin/python3

Did you install this from source code yourself?  Yes, I did install from the source code by myself. Was not aware that CentOS would have relatively latest "Python 3".

which yes > /usr/bin/yes

Satinder Singh

unread,
Apr 6, 2021, 7:11:39 PMApr 6
to modwsgi
Just realised that default Python on my Cent OS 8 is 3.6.8. I can go ahead with that I guess! 

Graham Dumpleton

unread,
Apr 6, 2021, 7:17:40 PMApr 6
to mod...@googlegroups.com
Then you don't need /usr/local/python/Python-3.9.2 in PATH, which I suspect is wrong directory anyway.

Instead of using "configure" to build mod_wsgi, use mod_wsgi-express instead.

Thus, ensure you are using a Python virtual environment and then run:

    pip install mod_wsgi

If it installs okay, run:

    mod_wsgi-express start-server

to test it.

Then read:


Is going to be easier to use mod_wsgi-express if just starting out. But then, if just starting out, you should really just use the Django development server to test.

Graham

Reply all
Reply to author
Forward
0 new messages