Loadmodule error.

26 views
Skip to first unread message

Suraj Shaw

unread,
Mar 7, 2022, 2:23:41 PM3/7/22
to modwsgi
Hi ,

I am using the following configuration.I have installed mod_wsgi using pip command.I am using macos bigSur(11.6.2). 

mod-wsgi==4.9.0

Server version: Apache/2.4.51 (Unix) - Apple Version

I am getting the following error

httpd: Syntax error on line 191 of /private/etc/apache2/httpd.conf: Cannot load /Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so into server: dlopen(/Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so, 10): Library not loaded: @rpath/Python3.framework/Versions/3.8/Python3\n  Referenced from: /Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so\n  Reason: image not found

Could anyone please guide me on this.

Thanks and Regards 
Suraj

Graham Dumpleton

unread,
Mar 7, 2022, 2:57:22 PM3/7/22
to mod...@googlegroups.com
Give the OS version, I presume this is an Intel system?

What do you get when you run:

    file /Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so

and:

    file /usr/sbin/httpd

and:

    which apxs

and:

    apxs -q BINDIR

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/a5b75dca-04da-423c-abcd-9464fd19088en%40googlegroups.com.

Suraj Shaw

unread,
Mar 8, 2022, 3:18:45 AM3/8/22
to modwsgi
Hi,
 macOS - Big Sur (11.6.2) . Yes its an Intel System.

file /Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so

/Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit bundle x86_64] [arm64:Mach-O 64-bit bundle arm64]

/Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so (for architecture x86_64): Mach-O 64-bit bundle x86_64

/Users/apple/.virtualenvs/djangodev/lib/python3.8/site-packages/mod_wsgi/server/mod_wsgi-py38.cpython-38-darwin.so (for architecture arm64): Mach-O 64-bit bundle arm64


file /usr/sbin/httpd

/usr/sbin/httpd: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64e:Mach-O 64-bit executable arm64e]

/usr/sbin/httpd (for architecture x86_64): Mach-O 64-bit executable x86_64

/usr/sbin/httpd (for architecture arm64e): Mach-O 64-bit executable arm64e


which apxs

apxs not found

apxs -q BINDIR

zsh: command not found: apxs


I have installed mod_wsgi using the command - >     pip install mod_wsgi

Thanks
Suraj


Graham Dumpleton

unread,
Mar 8, 2022, 3:24:48 AM3/8/22
to mod...@googlegroups.com
Who's Python distribution are you using? It is actually the Python distribution that looks to be the problem. Doesn't look like it has been configured correctly when built such that it can be used in embedded systems. Haven't see the problem for many many years and when did was with a packaging system for MacOS apps that as far as I know doesn't exist anymore.

Graham

Suraj Shaw

unread,
Mar 8, 2022, 6:00:56 AM3/8/22
to modwsgi
Hi,

I am not sure about who's python distribution i am using. But i am using Python(3.8.9) and i using a virtual environment. So could you please guide me how should i proceed further.

Thanks

Graham Dumpleton

unread,
Mar 8, 2022, 6:04:26 AM3/8/22
to mod...@googlegroups.com
All I can tell you is that the Python distribution is broken, or it could actually be the virtual environment itself.

Get down the newest Python version you can that supports that macOS version from the Python Software Foundation. Install and use that instead.


You will need to create a new Python virtual environment against the newer Python version and use it.

Use the "python -m venv" command to create the virtual environment rather than a separate tool.

Graham

Suraj Shaw

unread,
Mar 8, 2022, 6:11:57 AM3/8/22
to modwsgi
So I will need to first uninstall the the installed python3. What would be the command which will only delete my python3 version and not the python2 version.

Thanks.

Suraj Shaw

unread,
Mar 8, 2022, 6:16:28 AM3/8/22
to modwsgi

ls -ls /usr/bin/python*   

Output for the above command is this. this shows all the pythons installed .

0 lrwxr-xr-x  1 root  wheel      75 Jan  1  2020 /usr/bin/python -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

 0 lrwxr-xr-x  1 root  wheel      82 Jan  1  2020 /usr/bin/python-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

 0 lrwxr-xr-x  1 root  wheel      75 Jan  1  2020 /usr/bin/python2 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

 0 lrwxr-xr-x  1 root  wheel      75 Jan  1  2020 /usr/bin/python2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7

 0 lrwxr-xr-x  1 root  wheel      82 Jan  1  2020 /usr/bin/python2.7-config -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config

24 -rwxr-xr-x  1 root  wheel  137616 Jan  1  2020 /usr/bin/python3

 0 lrwxr-xr-x  1 root  wheel      76 Jan  1  2020 /usr/bin/pythonw -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7

 0 lrwxr-xr-x  1 root  wheel      76 Jan  1  2020 /usr/bin/pythonw2.7 -> ../../System/Library/Frameworks/Python.framework/Versions/2.7/bin/pythonw2.7

Graham Dumpleton

unread,
Mar 8, 2022, 6:20:54 AM3/8/22
to mod...@googlegroups.com
You don't need to uninstall python3. It looks like it even be that supplied by the operating system.

Just install the Python Software Foundation version and then for example run Python as "python3.10", rather than "python3" when creating the virtual environment.

Reply all
Reply to author
Forward
0 new messages