简体   繁体   English

从源安装mod_wsgi时出错

[英]Error installing mod_wsgi from source

I installed apr-1.5.2 , apr-util-1.5.4 , apr-iconv-1.2.1 , and httpd-2.4.25 all by building it from source. 我通过从源代码构建它来安装apr-1.5.2apr-util-1.5.4apr-iconv-1.2.1httpd-2.4.25 Using the default settings. 使用默认设置。 But every time I tries to build mod_wsgi, it always show this error. 但每次我尝试构建mod_wsgi时,它总是显示此错误。 I tried what other answers suggested but nothing helped. 我尝试了其他答案,但没有任何帮助。

I'm running Mac OSX with python 3 and installed Xcode-select just as the installation guide said I should. 我正在使用python 3运行Mac OSX并安装了Xcode-select,正如安装指南所说的那样。 But I don't have Xcode(No where in the installation guide said that I need to). 但是我没有Xcode(没有安装指南中的哪个地方说我需要)。 How can I not get this error? 我怎么能得不到这个错误?

$./configure
checking for apxs2... no
checking for apxs... /usr/sbin/apxs
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
cat: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/share/apr-1/build-1/libtool: No such file or directory
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for prctl... no
checking Apache version... apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
2.4.23
apxs:Error: /Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config not found!.
configure: creating ./config.status
config.status: creating Makefile

If I use pip, I also get the same error... 如果我使用pip,我也会得到同样的错误......

$pip3 install mod_wsgi
Collecting mod_wsgi
  Using cached mod_wsgi-4.5.14.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/7l/3hjlgnpj3mdf61ptzzdwtzf80000gn/T/pip-build-yvl7rbe8/mod-wsgi/setup.py", line 298, in <module>
        APR_INCLUDES = get_apr_includes().split()
      File "/private/var/folders/7l/3hjlgnpj3mdf61ptzzdwtzf80000gn/T/pip-build-yvl7rbe8/mod-wsgi/setup.py", line 259, in get_apr_includes
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 707, in __init__
        restore_signals, start_new_session)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/subprocess.py", line 1326, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: '/Applications/Xcode.app/Contents/Developer/Toolchains/OSX10.12.xctoolchain/usr/local/bin/apr-1-config'

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7l/3hjlgnpj3mdf61ptzzdwtzf80000gn/T/pip-build-yvl7rbe8/mod-wsgi/

Use pip installable mod_wsgi as explained in: 使用pip安装的mod_wsgi,如下所述:

if using MacOS X. 如果使用MacOS X.

You can no longer use config/make/make install method on MacOS X as Apple no longer ship the bits required for it to work. 您不能再在MacOS X上使用config / make / make install方法,因为Apple不再提供其工作所需的位。

Once installed using pip , follow steps as explained in section "Connecting into Apache installation" to hook it into Apache. 使用pip安装后,按照“连接到Apache安装”一节中的说明执行操作,将其挂钩到Apache。

You can alternatively use homebrew to install it. 您也可以使用homebrew来安装它。 Use the following command. 使用以下命令。 It'll install all the dependencies and finally mod_wsgi 它将安装所有依赖项,最后安装mod_wsgi

brew install mod_wsgi --with-brewed-httpd24

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM