You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unable to compile mod_python due to "apxs:Error: Command failed with rc=9240576" during make command #137
I didn't install python by compiling it - I installed it by doing sudo apt-get install python3-pip. https://docs.python.org/3/using/configure.html suggests that --enable-shared will build a shared Python library - libpython. If that's the case then it stands to reason that doing sudo apt-get install libpython3-dev should be sufficient but when I do that it shows that that's already installed.
Why is sudo apt-get install python3-pip insufficient? Am I going to have to compile Apache and gcc and Linux, too?
So I just compiled the latest version of Python by doing this:
wget https://www.python.org/ftp/python/3.12.3/Python-3.12.3.tgz
tar xvzf Python-3.12.3.tgz
cd Python-3.12.3
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make
make install
pip3 install setuptools
Now when I try to do make on mod_python I'm getting this error:
/usr/local/bin/python3 setup.py build
Traceback (most recent call last):
File "/root/mod_python/dist/setup.py", line 204, in <module>
setup(name="mod_python",
File "/usr/local/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
return distutils.core.setup(**attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 146, in setup
_setup_distribution = dist = klass(attrs)
^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/setuptools/dist.py", line 318, in __init__
self.metadata.version = self._normalize_version(self.metadata.version)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/setuptools/dist.py", line 354, in _normalize_version
normalized = str(Version(version))
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/setuptools/_vendor/packaging/version.py", line 200, in __init__
raise InvalidVersion(f"Invalid version: '{version}'")
setuptools.extern.packaging.version.InvalidVersion: Invalid version: 'error: unknown option `exclude'
usage: git describe [<options>] [<commit-ish>...]
or: git describe [<options>] --dirty
--contains find the tag that comes after the commit
--debug debug search strategy on stderr
--all use any ref
--tags use any tag, even unannotated
--long always use long format
--first-parent only follow first parent
--abbrev[=<n>] use <n> digits to display SHA-1s
--exact-match only output exact matches
--candidates <n> consider <n> most recent tags (default: 10)
--match <pattern> only consider tags matching <pattern>
--always show abbreviated commit object as fallback
--dirty[=<mark>] append <mark> on dirty working tree (default: "-dirty")
3.5.0+'
Makefile:24: recipe for target 'build' failed
make[1]: *** [build] Error 1
Your git is too old and doesn't support the --exclude option, so one thing to try is to upgrade it. Another, perhaps simpler thing to try instead, is to remove git from the path - the compile should work just fine without git. Just rename your git binary temporarily to something else and try compiling again.
Activity
grisha commentedon May 12, 2024
This probably means that your Python was compiled without the
--enable-sharedoption.prescriptionlifeline commentedon May 13, 2024
I didn't install python by compiling it - I installed it by doing
sudo apt-get install python3-pip. https://docs.python.org/3/using/configure.html suggests that--enable-sharedwill build a shared Python library -libpython. If that's the case then it stands to reason that doingsudo apt-get install libpython3-devshould be sufficient but when I do that it shows that that's already installed.Why is
sudo apt-get install python3-pipinsufficient? Am I going to have to compile Apache and gcc and Linux, too?grisha commentedon May 13, 2024
That was just a guess. I think on Ubuntu you can just try installing the
libapache2-mod-pythonpackage and avoid compiling.prescriptionlifeline commentedon May 23, 2024
So I just compiled the latest version of Python by doing this:
Now when I try to do
makeon mod_python I'm getting this error:Any ideas?
grisha commentedon May 23, 2024
Your git is too old and doesn't support the
--excludeoption, so one thing to try is to upgrade it. Another, perhaps simpler thing to try instead, is to remove git from the path - the compile should work just fine without git. Just rename your git binary temporarily to something else and try compiling again.