0

I want to install Apache server module mod_wsgi on (Server version: Apache/2.4.56) Amazon Linux 2023 a Lightsail Instance. I have python3.9 and I tried with rpm it's showing error - Problem: conflicting requests nothing provides libpython2.7.so.1.0()(64bit) needed by mod_wsgi-3.4-12.amzn2.0.2.x86_64

Yum install command is unable to find package. pip install is also not working.

Tried with Source Code (mod_wsgi) but it showing error for - apxs2, perhaps it will require to install httpd-devel and I am supposed that it may affect my already installed httpd on which sites are published.

Upgrades are available - releasever=2023.2.20231018 & releasever=2023.2.20231026 Can upgrades fix it?

So please help me, how to install it?

1 Answer 1

0

Try the following:

  1. RPM Error - Python 2.7 Dependency: The RPM is for an older version of mod_wsgi that requires Python 2.7. Find an RPM compatible with Python 3.9, or compile mod_wsgi from source using Python 3.9.

  2. Yum Can't Find Package: mod_wsgi may not be in the default repositories. Enable EPEL and try again:

    sudo amazon-linux-extras install epel
    sudo yum install mod_wsgi
    
  3. Pip Install Not Working: mod_wsgi is an Apache module, not a Python package, so it can't be installed with pip.

  4. Source Code Compilation Errors: Install httpd-devel to get the apxs tool without affecting the current httpd:

    sudo yum install httpd-devel
    
  5. System Upgrades: While updating may not directly fix mod_wsgi issues, it's a good practice:

    sudo yum update
    

After the update, try installing mod_wsgi again via yum.

3
  • Thanks for help! It is Amazon 2023 AMI so as I know it does not support EPEL. I will try to find RPM compatible with Python 3.9. Nov 27 at 9:02
  • I am stuck here - [user@ip-xx-xx-xx-xx opt]$ rpm -i python39-mod_wsgi-4.7.1-7.module_el8+639+3fcd10de.x86_64.rpm warning: python39-mod_wsgi-4.7.1-7.module_el8+639+3fcd10de.x86_64.rpm: Header V4 RSA/SHA256 Signature, key ID 8483c65d: NOKEY error: Failed dependencies: python39-setuptools is needed by python39-mod_wsgi-4.7.1-7.module_el8+639+3fcd10de.x86_64 === [user@ip-xx-xx-xx-xx opt]$ pip3.9 install setuptools Defaulting to user installation because normal site-packages is not writeable Requirement already satisfied: setuptools in /usr/lib/python3.9/site-packages (59.6.0) Nov 30 at 7:44
  • Also tried ... [user@ip-xx-xx-xx-xx opt]$ cd /usr/lib/python3.9/site-packages [user@ip-xx-xx-xx-xx site-packages]$ python3.9 Python 3.9.16 (main, Sep 8 2023, 00:00:00) [GCC 11.4.1 20230605 (Red Hat 11.4.1-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import setuptools >>> [user@ip-xx-xx-xx-xx opt]$ sudo yum install python3.9-setuptools Last metadata expiration check: 1 day, 20:43:33 ago on Tue Nov 28 16:15:02 2023. Package python3-setuptools-59.6.0-2.amzn2023.0.4.noarch is already installed. Dependencies resolved. Nothing to do. Nov 30 at 7:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .