Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

problems with pip install mod-wsgi

I'm new IT and programming; I been struggling to install mod_wsgi with pip

Example in cmd:

pip install mod_wsgi

I been trying to lunch my django project on my own pc acting as a server

I'm using Apcache 24 and my PC is windows 10, 64bits

My python is 3.7.1 and Django is 2.1.3

Solution I had try:

  1. https://stackoverflow.com/a/42323871/10865416

error:

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

I had check and and intsall the C++ 14 here the link where I download: https://www.microsoft.com/en-gb/download/details.aspx?id=48145

  1. download and install manually
    https://github.com/sammchardy/python-binance/issues/148#issuecomment-374853521

error:

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:

    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\

and yes hd VC10 install to had this error, here the link https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2017

In advance thank you for your help, apprentice it

like image 874
I'm a IT Dumb Head Avatar asked Oct 14 '25 04:10

I'm a IT Dumb Head


2 Answers

  1. Some of the pip packages are downloaded as source code, then compiled on the user pc and installed, to compile certain packages different c++ libraries and header files are required, which comes with Microsoft Visual C++ 14.0 package. You have installed Visual C++ Redistributable for Visual Studio 2015, which installs run-time components that are required to run C++ applications built using Visual Studio 2015, not compiler libraries which are required to compile from source. You have to install Visual Studio C++ packages, From this link Visual studio.

  2. Your python version is 3.7.1, you are trying to install mod_wsgi-4.5.24+ap24vc14-cp35-cp35m-wind_amd64.whl which is compiled to work for python version 3.5, on Windows x86_64 arch, not compatible for your system.

  3. Again, required C++ libraries not found in your system.

like image 101
arryph Avatar answered Oct 16 '25 17:10

arryph


Hi I've been struggling with the same issue lately, the way I found to overcome it was to download Microsoft Visual studio, and then start a new C++ project. MVS will download the required components to compile mod_wsgi and everything should be fine after that

Hope it helps

like image 36
Theophile Avatar answered Oct 16 '25 18:10

Theophile



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!