Hi all,
I have a collection of mercurial repositories which are exposed by a Slackware 14.2 server on which I have configured apache to use mod_wsgi module. The repositories are exposed via http by using
hgweb.
Now I'm trying to migrate the same installation on Slackware 15.0 but unfortunately it seems something is not working as expected.
I installed mod_wsgi from Slackbuid. No problem
Anyway when I try to access to any of the mercurial repositories via http I got an error from Apache. The Apache log reports:
Code:
ImportError: No module named mercurial,
I guess this is due to the fact that on Slackware 15 there are two python versions available: python2.7 and python3.9 but only the 3.9 has installed mercurial module.
As mod_wsgi has been compiled using python2.7 obviously mercurial is not found.
At this point I tried to different things:
1- modify the slackbuid to use python3.9 instead 2.7 but didn't work because I got the following compilation error:
Code:
/usr/include/python3.9/ceval.h:17:43: note: declared here
17 | Py_DEPRECATED(3.9) PyAPI_FUNC(PyObject *) PyEval_CallObjectWithKeywords(
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/server/wsgi_interp.c:261:32: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
261 | tstate = tstate->interp->tstate_head;
| ^~
src/server/wsgi_interp.c: In function ‘newInterpreterObject’:
src/server/wsgi_interp.c:358:22: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
358 | while (interp->next)
| ^~
src/server/wsgi_interp.c:359:28: error: invalid use of incomplete typedef ‘PyInterpreterState’ {aka ‘struct _is’}
359 | interp = interp->next;
| ^~
2- install mercurial module on python2.7 but also this didn't work:
Code:
mod_wsgi# pip2 install mercurial
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting mercurial
Using cached mercurial-6.2.2.tar.gz (8.1 MB)
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python2 /usr/lib64/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp9x7bGo
cwd: /tmp/pip-install-T6NCZD/mercurial
Complete output (19 lines):
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 257, in <module>
main()
File "/usr/lib64/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 240, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/lib64/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 91, in get_requires_for_build_wheel
return hook(config_settings)
File "/tmp/pip-build-env-_5RZBM/overlay/lib64/python2.7/site-packages/setuptools/build_meta.py", line 146, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=['wheel'])
File "/tmp/pip-build-env-_5RZBM/overlay/lib64/python2.7/site-packages/setuptools/build_meta.py", line 127, in _get_build_requires
self.run_setup()
File "/tmp/pip-build-env-_5RZBM/overlay/lib64/python2.7/site-packages/setuptools/build_meta.py", line 243, in run_setup
self).run_setup(setup_script=setup_script)
File "/tmp/pip-build-env-_5RZBM/overlay/lib64/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 45
print(error, file=sys.stderr)
^
SyntaxError: invalid syntax
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python2 /usr/lib64/python2.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmp9x7bGo Check the logs for full command output.
Any idea on how to fix the issue?
Thanks a lot!