pip install mod-wsgi 的问题

problems with pip install mod-wsgi

我是 IT 和编程新手;我一直在努力用 pip

安装 mod_wsgi

命令中的示例:

pip install mod_wsgi

我一直在尝试在我自己充当服务器的电脑上运行我的 django 项目

我正在使用 Apcache 24 我的 PC 是 windows 10、64 位

我的 python 是 3.7.1Django 是 2.1.3

我试过的解决方案:

错误:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/

我在 link 下载的地方检查并安装了 C++ 14: https://www.microsoft.com/en-gb/download/details.aspx?id=48145

  1. 手动下载并安装
    https://github.com/sammchardy/python-binance/issues/148#issuecomment-374853521

错误:

C:\Users\user>pip install C:/mod_wsgi-4.5.24+ap24vc14-cp37-cp37m-win_amd64.rar
Invalid requirement: 'C:/mod_wsgi-4.5.24+ap24vc14-cp37-cp37m-win_amd64.rar'
Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\packaging\requirements.py", line 93, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1654, in parseString
    raise exc
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1644, in parseString
    loc, tokens = self._parse( instring, 0 )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1402, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 3417, in parseImpl
    loc, exprtokens = e._parse( instring, loc, doActions )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 1406, in _parseNoCache
    loc,tokens = self.parseImpl( instring, preloc, doActions )
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\pyparsing.py", line 3205, in parseImpl
    raise ParseException(instring, loc, self.errmsg, self)
pip._vendor.pyparsing.ParseException: Expected stringEnd (at char 1), (line:1, col:2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_internal\req\constructors.py", line 253, in install_req_from_line
    req = Requirement(req)
  File "c:\users\user\appdata\local\programs\python\python37-32\lib\site-packages\pip\_vendor\packaging\requirements.py", line 96, in __init__
    requirement_string[e.loc:e.loc + 8], e.msg
pip._vendor.packaging.requirements.InvalidRequirement: Parse error at "':/mod_ws'": Expected stringEnd
  1. https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/win32/README.rst

错误:

    error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\link.exe' failed with exit status 1120

    ----------------------------------------
Command "c:\users\user\appdata\local\programs\python\python37-32\python.exe -u -c "import setuptools, tokenize;__file__='C:\Users\user\AppData\Local\Temp\pip-install-f9igth3o\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 C:\Users\user\AppData\Local\Temp\pip-record-kmcbksbk\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\user\AppData\Local\Temp\pip-install-f9igth3o\mod-wsgi\

是的,hd VC10 安装有这个错误,这里是 link https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017

在此先感谢大家的帮助,拜师吧

  1. 有些pip包是下载源代码,然后在用户电脑上编译安装,编译某些包需要不同的c++库和头文件,Microsoft Visual C++ 14.0 包裹。您已经安装了 Visual C++ Redistributable for Visual Studio 2015,它安装了 运行 使用 Visual Studio 2015 构建的 C++ 应用程序所需的 run-time components,而不是从源代码编译所需的 compiler libraries。你必须安装 Visual Studio C++ 包,从这个 link Visual studio.

  2. 您的 python 版本是 3.7.1,您正在尝试安装 mod_wsgi-4.5.24+ap24vc14-cp35-cp35m-wind_amd64.whl,它被编译为适用于 python 版本 3.5, 在 Windows x86_64 架构上,与您的系统不兼容。

  3. 同样,在您的系统中找不到所需的 C++ 库。

嗨,我最近一直在为同样的问题苦苦挣扎, 我发现克服它的方法是下载 Microsoft Visual studio,然后开始一个新的 C++ 项目。 MVS 将下载所需的组件进行编译 mod_wsgi,之后一切都应该没问题

希望对您有所帮助

现在真的觉得很傻;

我弄清楚为什么系统安装 mod_wsgi 64 位,因为我的 python 是 32 位的。

但是非常感谢你帮助我,带领我解决了ubisun和arryph的问题