簡體   English   中英

從源安裝mod_wsgi時出錯

[英]Error installing mod_wsgi from source

我通過從源代碼構建它來安裝apr-1.5.2apr-util-1.5.4apr-iconv-1.2.1httpd-2.4.25 使用默認設置。 但每次我嘗試構建mod_wsgi時,它總是顯示此錯誤。 我嘗試了其他答案,但沒有任何幫助。

我正在使用python 3運行Mac OSX並安裝了Xcode-select,正如安裝指南所說的那樣。 但是我沒有Xcode(沒有安裝指南中的哪個地方說我需要)。 我怎么能得不到這個錯誤?

$./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

如果我使用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/

使用pip安裝的mod_wsgi,如下所述:

如果使用MacOS X.

您不能再在MacOS X上使用config / make / make install方法,因為Apple不再提供其工作所需的位。

使用pip安裝后,按照“連接到Apache安裝”一節中的說明執行操作,將其掛鈎到Apache。

您也可以使用homebrew來安裝它。 使用以下命令。 它將安裝所有依賴項,最后安裝mod_wsgi

brew install mod_wsgi --with-brewed-httpd24

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM