mod_wsgi installation on centos with Python3.7

75 views
Skip to first unread message

Mahesh Vernekar

unread,
Jul 10, 2019, 2:06:06 PM7/10/19
to modwsgi
Hi Graham,

Is there a specific method to install mod_wsgi for Python 3.7 ?

We are trying to install using command 
pip install mod-wsgi
or
pip3.7 install mod-wsgi

But installation fails with gcc error. Gcc has been installed though.

Any idea any step we are missing ?

Operating System is centos 7

Thanks 
Mahesh Vernekar
3PS Media India Pvt. Ltd 

Graham Dumpleton

unread,
Jul 10, 2019, 8:40:42 PM7/10/19
to mod...@googlegroups.com

On 11 Jul 2019, at 4:06 am, Mahesh Vernekar <mahesh....@gmail.com> wrote:

Hi Graham,

Is there a specific method to install mod_wsgi for Python 3.7 ?

We are trying to install using command 
pip install mod-wsgi
or
pip3.7 install mod-wsgi

But installation fails with gcc error. Gcc has been installed though.

What was the error?

You need to have the relevant python devel and Apache httpd devel packages installed as well. Do you have them installed?

The need for these to be installed in mentioned in:



Any idea any step we are missing ?

Operating System is centos 7

Thanks 
Mahesh Vernekar
3PS Media India Pvt. Ltd 

--
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 post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
To view this discussion on the web visit https://groups.google.com/d/msgid/modwsgi/5d4d101c-7953-49b8-ab3e-d0b042b4adb6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mahesh Vernekar

unread,
Jul 10, 2019, 10:41:27 PM7/10/19
to modwsgi
Hi Graham,

Thanks for the quick response.

python-devel and httpd-devel is installed.

Message for yum install httpd-devel
Package httpd-devel-2.4.6-89.el7.centos.x86_64 already installed and latest version

Message for pip3.7 install httpd-devel
Collecting httpd-devel
  Could not find a version that satisfies the requirement httpd-devel (from versions: )
No matching distribution found for httpd-devel

Message for yum install python-devel
Package python-devel-2.7.5-80.el7_6.x86_64 already installed and latest version

Message for pip3.7 install python-devel
Collecting python-devel
  Could not find a version that satisfies the requirement python-devel (from versions: )
No matching distribution found for python-devel

I think the issue is due to the python-devel is being installed for ver 2.7

Not able to figure out the correct packages that are to be installed.


Regards

Mahesh






--
You received this message because you are subscribed to a topic in the Google Groups "modwsgi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/modwsgi/2wrNFucE1P4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to modwsgi+u...@googlegroups.com.

Graham Dumpleton

unread,
Jul 11, 2019, 12:38:53 AM7/11/19
to mod...@googlegroups.com
You still didn’t show the error messages you got when trying to pip install mod_wsgi.

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 post to this group, send email to mod...@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.

Mahesh Vernekar

unread,
Jul 11, 2019, 1:04:29 AM7/11/19
to modwsgi
Hi Graham,

Error message displayed while installing 
pip install pip install mod_wsgi
bash: pip: command not found

[root@ip-172-30-2-254 centos]# pip3.7 install pip install mod_wsgi
Requirement already satisfied: pip in /usr/local/lib/python3.7/site-packages (19.0.3)
Collecting install
  Could not find a version that satisfies the requirement install (from versions: )
No matching distribution found for install

Regards

Mahesh

Mahesh Vernekar

unread,
Jul 11, 2019, 1:08:59 AM7/11/19
to modwsgi
[root@ip-172-30-2-254 centos]# pip install mod_wsgi

bash: pip: command not found

[root@ip-172-30-2-254 centos]# pip3.7 install mod_wsgi
Collecting mod_wsgi
< does some processing and finally get the below error >

collect2: error: ld returned 1 exit status
    error: command 'gcc' failed with exit status 1
   
    ----------------------------------------
Command "/usr/local/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-mpchnbay/mod-wsgi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-u73j4jz8/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-mpchnbay/mod-wsgi/


Regards

Mahesh




On Thu, Jul 11, 2019 at 10:08 AM Graham Dumpleton <graham.d...@gmail.com> wrote:

Graham Dumpleton

unread,
Jul 11, 2019, 1:32:00 AM7/11/19
to mod...@googlegroups.com
I need to see what was at:

    < does some processing and finally get the below error >

That was the real error message.

If necessary run pip with the -v option to show verbose output.

Anderson Marques

unread,
Jul 15, 2019, 3:21:26 PM7/15/19
to mod...@googlegroups.com
Hello, I recently did an installation on centos7, follow the steps.

yum install mod_wsgi
Download git latest version https://github.com/GrahamDumpleton/mod_wsgi/releases
tar xvfz x.x.x-X.Y.tar.gz
cd x.x.x
./configure --with-apxs = /usr/bin/apxs --with-python=/usr/local/bin/python3.7
make
make install

you can use a find apxs to know the location of the file.

I hope it helps.

Mahesh Vernekar

unread,
Jul 16, 2019, 5:18:59 AM7/16/19
to modwsgi
Hi Anderson,

Thanks for your suggestion.
I tried the sequence but getting error as below:
for make command.
collect2: error: ld returned 1 exit status
apxs:Error: Command failed with rc=65536

I have another question ?
Did you install python-devel for Python 3.7 ?
If installed what was the command ?

Regards

Mahesh


Graham Dumpleton

unread,
Jul 16, 2019, 6:52:41 AM7/16/19
to mod...@googlegroups.com

On 16 Jul 2019, at 7:18 pm, Mahesh Vernekar <mahesh....@gmail.com> wrote:

Hi Anderson,

Thanks for your suggestion.
I tried the sequence but getting error as below:
for make command.
collect2: error: ld returned 1 exit status
apxs:Error: Command failed with rc=65536

As I already pointed out, that part of the error message says nothing, it is just the result status.

It is all the messages before that which are the important bit. Is there a reason you can't supply them as already asked?

Graham

Anderson Marques

unread,
Jul 16, 2019, 10:21:51 AM7/16/19
to mod...@googlegroups.com
Hello Mahesh, yes this installed python-devel.

What are you installing so much? What is the senary?

Mahesh Vernekar

unread,
Jul 17, 2019, 4:22:02 AM7/17/19
to modwsgi
Hi Graham,

The complete messages displayed during installation is as follows:

[root@ip-172-30-2-254 centos]# pip3.7 install mod_wsgi

Collecting mod_wsgi

  Using cached https://files.pythonhosted.org/packages/26/03/a3ed5abc2e66c82c40b0735c2f819c898d136879b00be4f5537126b6a4a4/mod_wsgi-4.6.7.tar.gz

Installing collected packages: mod-wsgi

  Running setup.py install for mod-wsgi ... error

    ERROR: Complete output from command /usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-thqracds/mod-wsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fwtvsxkv/install-record.txt --single-version-externally-managed --compile:

    ERROR: 

    WARNING: The Python installation you are using does not appear to have

    been installed with a shared library, or in the case of MacOS X, as a

    framework. Where these are not present, the compilation of mod_wsgi may

    fail, or if it does succeed, will result in extra memory being used by

    all processes at run time as a result of the static library needing to

    be loaded in its entirety to every process. It is highly recommended

    that you reinstall the Python installation being used from source code,

    supplying the '--enable-shared' option to the 'configure' script when

    configuring the source code prior to building and installing it.

    

    /usr/local/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'bugtrack_url'

      warnings.warn(msg)

    running install

    running build

    running build_py

    creating build

    creating build/lib.linux-x86_64-3.7

    creating build/lib.linux-x86_64-3.7/mod_wsgi

    copying src/__init__.py -> build/lib.linux-x86_64-3.7/mod_wsgi

    creating build/lib.linux-x86_64-3.7/mod_wsgi/server

    copying src/server/__init__.py -> build/lib.linux-x86_64-3.7/mod_wsgi/server

    copying src/server/environ.py -> build/lib.linux-x86_64-3.7/mod_wsgi/server

    copying src/server/apxs_config.py -> build/lib.linux-x86_64-3.7/mod_wsgi/server

    creating build/lib.linux-x86_64-3.7/mod_wsgi/server/management

    copying src/server/management/__init__.py -> build/lib.linux-x86_64-3.7/mod_wsgi/server/management

    creating build/lib.linux-x86_64-3.7/mod_wsgi/server/management/commands

    copying src/server/management/commands/__init__.py -> build/lib.linux-x86_64-3.7/mod_wsgi/server/management/commands

    copying src/server/management/commands/runmodwsgi.py -> build/lib.linux-x86_64-3.7/mod_wsgi/server/management/commands

    creating build/lib.linux-x86_64-3.7/mod_wsgi/docs

    copying docs/_build/html/__init__.py -> build/lib.linux-x86_64-3.7/mod_wsgi/docs

    creating build/lib.linux-x86_64-3.7/mod_wsgi/images

    copying images/__init__.py -> build/lib.linux-x86_64-3.7/mod_wsgi/images

    copying images/snake-whiskey.jpg -> build/lib.linux-x86_64-3.7/mod_wsgi/images

    running build_ext

    building 'mod_wsgi.server.mod_wsgi-py37' extension

    creating build/temp.linux-x86_64-3.7

    creating build/temp.linux-x86_64-3.7/src

    creating build/temp.linux-x86_64-3.7/src/server

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/mod_wsgi.c -o build/temp.linux-x86_64-3.7/src/server/mod_wsgi.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    src/server/mod_wsgi.c: In function 'wsgi_socket_sendv':

    src/server/mod_wsgi.c:10966:44: warning: signed and unsigned type in conditional expression [-Wsign-compare]

                         (nvec < iov_max ? nvec : (int)iov_max));

                                                ^

    src/server/mod_wsgi.c: In function 'wsgi_scan_headers':

    src/server/mod_wsgi.c:11125:30: warning: signed and unsigned type in conditional expression [-Wsign-compare]

         buflen = buffer ? buflen : sizeof(x);

                                  ^

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_apache.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_apache.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_buckets.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_buckets.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_convert.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_convert.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_daemon.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_daemon.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_interp.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_interp.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_logger.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_logger.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_memory.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_memory.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_metrics.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_metrics.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_restrict.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_restrict.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_server.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_server.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_stream.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_stream.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_thread.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_thread.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/include/httpd -I/usr/local/include/python3.7m -c src/server/wsgi_validate.c -o build/temp.linux-x86_64-3.7/src/server/wsgi_validate.o -I/usr/include/httpd -I. -I/usr/include/apr-1 -DLINUX -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -pthread -I/usr/include/apr-1 -I/usr/include/apr-1

    gcc -pthread -shared build/temp.linux-x86_64-3.7/src/server/mod_wsgi.o build/temp.linux-x86_64-3.7/src/server/wsgi_apache.o build/temp.linux-x86_64-3.7/src/server/wsgi_buckets.o build/temp.linux-x86_64-3.7/src/server/wsgi_convert.o build/temp.linux-x86_64-3.7/src/server/wsgi_daemon.o build/temp.linux-x86_64-3.7/src/server/wsgi_interp.o build/temp.linux-x86_64-3.7/src/server/wsgi_logger.o build/temp.linux-x86_64-3.7/src/server/wsgi_memory.o build/temp.linux-x86_64-3.7/src/server/wsgi_metrics.o build/temp.linux-x86_64-3.7/src/server/wsgi_restrict.o build/temp.linux-x86_64-3.7/src/server/wsgi_server.o build/temp.linux-x86_64-3.7/src/server/wsgi_stream.o build/temp.linux-x86_64-3.7/src/server/wsgi_thread.o build/temp.linux-x86_64-3.7/src/server/wsgi_validate.o -o build/lib.linux-x86_64-3.7/mod_wsgi/server/mod_wsgi-py37.cpython-37m-x86_64-linux-gnu.so -L/usr/local/lib -L/usr/local/lib/python3.7/config-3.7m-linux -lpython3.7m

    /bin/ld: /usr/local/lib/libpython3.7m.a(abstract.o): relocation R_X86_64_32S against symbol `_Py_NotImplementedStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(boolobject.o): relocation R_X86_64_32S against symbol `_Py_FalseStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bytearrayobject.o): relocation R_X86_64_32 against symbol `_PyByteArray_empty_string' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bytesobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(call.o): relocation R_X86_64_32S against symbol `PyFunction_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(codeobject.o): relocation R_X86_64_32S against symbol `PyUnicode_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(complexobject.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(exceptions.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(fileobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(floatobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(frameobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(funcobject.o): relocation R_X86_64_32S against symbol `PyCode_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(iterobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(listobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(longobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(dictobject.o): relocation R_X86_64_32S against `.text.hot' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(memoryobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(methodobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(moduleobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(object.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(obmalloc.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(capsule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(rangeobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(setobject.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(sliceobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(structseq.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(tupleobject.o): relocation R_X86_64_32 against symbol `_PyEval_SliceIndexNotNone' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(typeobject.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(unicodeobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(unicodectype.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(weakrefobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_warnings.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bltinmodule.o): relocation R_X86_64_32S against symbol `PyFilter_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(ceval.o): relocation R_X86_64_32 against symbol `_PyRuntime' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(compile.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(codecs.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(errors.o): relocation R_X86_64_32S against symbol `PyTraceBack_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(future.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getargs.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getversion.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(import.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(importdl.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(marshal.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(modsupport.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(mystrtoul.o): relocation R_X86_64_32S against symbol `_Py_ctype_table' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pathconfig.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(peephole.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pyhash.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pylifecycle.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pystate.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(context.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(hamt.o): relocation R_X86_64_32S against symbol `_PyHamt_BitmapNode_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pythonrun.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pytime.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bootstrap_hash.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(symtable.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(sysmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(thread.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(traceback.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pystrtod.o): relocation R_X86_64_32S against symbol `_Py_ctype_tolower' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(dtoa.o): relocation R_X86_64_32S against `.bss' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(formatter_unicode.o): relocation R_X86_64_32S against symbol `_Py_ctype_table' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(fileutils.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(dynload_shlib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getpath.o): relocation R_X86_64_32 against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(main.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(gcmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(posixmodule.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(errnomodule.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(pwdmodule.o): relocation R_X86_64_32 against `.bss' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_sre.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_codecsmodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_weakref.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_functoolsmodule.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_operator.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_collectionsmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_abc.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(itertoolsmodule.o): relocation R_X86_64_32S against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(atexitmodule.o): relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(signalmodule.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_stat.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(timemodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_threadmodule.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_localemodule.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_iomodule.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(iobase.o): relocation R_X86_64_32 against symbol `_Py_FalseStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(fileio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bytesio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bufferedio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(textio.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(stringio.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(zipimport.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(faulthandler.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(_tracemalloc.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(hashtable.o): relocation R_X86_64_32 against symbol `PyMem_RawFree' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(symtablemodule.o): relocation R_X86_64_32 against symbol `PyUnicode_FSDecoder' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(xxsubtype.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getbuildinfo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(acceler.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(grammar1.o): relocation R_X86_64_32S against symbol `_PyParser_TokenNames' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(myreadline.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(parsetok.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(tokenizer.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(accu.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(bytes_methods.o): relocation R_X86_64_32S against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(cellobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(classobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(descrobject.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(enumobject.o): relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(genobject.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(odictobject.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(namespaceobject.o): relocation R_X86_64_32S against symbol `_PyNamespace_Type' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(Python-ast.o): relocation R_X86_64_32 against symbol `_Py_NoneStruct' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(ast.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(ast_opt.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(ast_unparse.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getcompiler.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getcopyright.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getplatform.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(structmember.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(getopt.o): relocation R_X86_64_32S against `.rodata.str4.4' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: /usr/local/lib/libpython3.7m.a(parser.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a shared object; recompile with -fPIC

    /bin/ld: final link failed: Nonrepresentable section on output

    collect2: error: ld returned 1 exit status

    error: command 'gcc' failed with exit status 1

    ----------------------------------------

ERROR: Command "/usr/local/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-thqracds/mod-wsgi/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-fwtvsxkv/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-thqracds/mod-wsgi/


Graham Dumpleton

unread,
Jul 17, 2019, 4:30:59 AM7/17/19
to mod...@googlegroups.com
This issue is documented in:


It is because your Python installation wasn't installed with a shared library. The warning at the top even tells you this:

    WARNING: The Python installation you are using does not appear to have
    been installed with a shared library, or in the case of MacOS X, as a
    framework. Where these are not present, the compilation of mod_wsgi may
    fail, or if it does succeed, will result in extra memory being used by
    all processes at run time as a result of the static library needing to
    be loaded in its entirety to every process. It is highly recommended
    that you reinstall the Python installation being used from source code,
    supplying the '--enable-shared' option to the 'configure' script when
    configuring the source code prior to building and installing it.

You will need to reinstall your Python from fresh source code with shared library enabled.

For some background on the correct way to install Python when using source code see:


Ignore that it talks about docker, it is still relevant.

Mahesh Vernekar

unread,
Jul 17, 2019, 4:35:55 AM7/17/19
to modwsgi
Thanks Graham.

That's what I thought. I will re-install python again and check.


Regards

Mahesh

Reply all
Reply to author
Forward
0 new messages