LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-03-2022, 01:33 PM   #1
gda
Member
 
Registered: Oct 2015
Posts: 130

Rep: Reputation: 27
Slackware 15.0, mod_wsgi and mercurial problem


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!
 
Old 10-03-2022, 03:10 PM   #2
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 591

Rep: Reputation: Disabled
The latest mod_wsgi which is 4.9.3 builds just fine when you add "--with-python=/usr/bin/python3" to the configure command.
 
1 members found this post helpful.
Old 10-04-2022, 04:58 AM   #3
gda
Member
 
Registered: Oct 2015
Posts: 130

Original Poster
Rep: Reputation: 27
I confirm that version 4.9.3 compiles fine against python3. All work as expected now. Thanks a lot!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fresh Django with mod_wsgi and apache goes Time Out on 18.04 Sefid par Ubuntu 0 07-08-2018 04:57 PM
LXer: How to Install and Configure Odoo with mod_wsgi LXer Syndicated Linux News 0 05-16-2017 03:21 PM
mercurial/mercurial-server Jany Linux - Software 0 02-26-2013 08:44 AM
[SOLVED] mod_wsgi mod_python doesnt compiling in slackware-current anti_user Slackware 2 09-10-2012 06:59 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 05:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration